mirror of
https://github.com/DreamMaoMao/maomaowm.git
synced 2025-10-29 05:40:21 -04:00
feat:Make all the keybind keys case-insensitive
This commit is contained in:
parent
7eac47b857
commit
2e02987128
4 changed files with 3 additions and 27 deletions
21
README.md
21
README.md
|
|
@ -110,27 +110,6 @@ like `MAOMAOCONFIG=/home/xxx/maomao`
|
|||
|
||||
- the fallback config path is in `/etc/maomao/config.conf`, you can find the default config here
|
||||
|
||||
# keybinds notice
|
||||
|
||||
All mod keys(alt,ctrl,shift,super,none) are case insensitive, in addition to other key names are case sensitive, the name follows the xkb standard name, you can use the `xev` command to get the key name of the key you want, note that if your mod key contains the shift key, then it may not be the key name displayed on the keyboard. Real name Refer to the name displayed in the `xev` command.
|
||||
|
||||
for example:
|
||||
|
||||
### this is wrong:
|
||||
|
||||
```
|
||||
bind=alt+shift,2,quit
|
||||
```
|
||||
|
||||
### this is right:
|
||||
|
||||
```
|
||||
bind=alt+shift,at,quit
|
||||
```
|
||||
|
||||
because your keybinds contain shift, the `2` cover to `at`
|
||||

|
||||
|
||||
# custom animation
|
||||
|
||||
```
|
||||
|
|
|
|||
|
|
@ -157,10 +157,7 @@ tags=id:9,layout_name:tile
|
|||
# monitorrule=HDMI-A-1,0.55,1,tile,0,1,1920,0
|
||||
|
||||
# Key Bindings
|
||||
# The mod key is not case sensitive,
|
||||
# but the second key is case sensitive,
|
||||
# if you use shift as one of the mod keys,
|
||||
# remember to use uppercase keys
|
||||
# All keys is not case sensitive,
|
||||
# mod keys name: super,ctrl,alt,shift,none
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -3716,7 +3716,7 @@ keybinding(uint32_t mods, xkb_keysym_t sym) {
|
|||
if (config.key_bindings_count < 1)
|
||||
break;
|
||||
k = &config.key_bindings[ji];
|
||||
if (CLEANMASK(mods) == CLEANMASK(k->mod) && sym == k->keysym && k->func) {
|
||||
if (CLEANMASK(mods) == CLEANMASK(k->mod) && xkb_keysym_to_upper(sym) == k->keysym && k->func) {
|
||||
k->func(&k->arg);
|
||||
handled = 1;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -299,7 +299,7 @@ uint32_t parse_mod(const char *mod_str) {
|
|||
}
|
||||
|
||||
xkb_keysym_t parse_keysym(const char *keysym_str) {
|
||||
return xkb_keysym_from_name(keysym_str, XKB_KEYSYM_NO_FLAGS);
|
||||
return xkb_keysym_to_upper(xkb_keysym_from_name(keysym_str, XKB_KEYSYM_NO_FLAGS));
|
||||
}
|
||||
|
||||
int parse_button(const char *str) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue