Make name optional

pull/48/head
Takashi Kokubun 2 years ago
parent 6ecb33b827
commit 9aebbd032c
No known key found for this signature in database
GPG Key ID: 6FFC433B12EE23DD

@ -1,3 +1,7 @@
## Unreleased
* `name` is made optional in `modmap` and `keymap`
## v0.1.4
* Add `--ignore` option to deny-list devices instead of allow-listing them

@ -104,7 +104,7 @@ is supported only in `modmap` since `keymap` handles modifier keys differently.
```yml
modmap:
- name: Name # Required
- name: Name # Optional
remap: # Required
KEY_XXX: KEY_YYY # Required
# or
@ -132,7 +132,7 @@ before any other key is pressed. Otherwise it's considered `held`.
```yml
keymap:
- name: Name # Required
- name: Name # Optional
remap: # Required
# key press -> key press
MOD1-KEY_XXX: MOD2-KEY_YYY

@ -1,6 +1,5 @@
modmap:
- name: SandS
remap:
- remap:
Space:
held: Shift_L
alone: Space

@ -11,6 +11,7 @@ use std::fmt::Formatter;
#[derive(Debug, Deserialize)]
#[serde(deny_unknown_fields)]
pub struct Keymap {
#[serde(default = "String::new")]
pub name: String,
#[serde(deserialize_with = "keymap_remap")]
pub remap: HashMap<KeyPress, Vec<Action>>,

@ -10,6 +10,7 @@ use std::fmt;
#[derive(Debug, Deserialize)]
#[serde(deny_unknown_fields)]
pub struct Modmap {
#[serde(default = "String::new")]
pub name: String,
#[serde(deserialize_with = "modmap_remap")]
pub remap: HashMap<Key, KeyAction>,

Loading…
Cancel
Save