mirror of
https://github.com/DreamMaoMao/maomaowm.git
synced 2026-03-06 01:40:45 -05:00
feat: add bing flag p
This commit is contained in:
parent
fbb38ad0b7
commit
58d4fe64da
2 changed files with 10 additions and 2 deletions
|
|
@ -43,6 +43,7 @@ typedef struct {
|
||||||
bool isdefaultmode;
|
bool isdefaultmode;
|
||||||
bool islockapply;
|
bool islockapply;
|
||||||
bool isreleaseapply;
|
bool isreleaseapply;
|
||||||
|
bool ispassapply;
|
||||||
} KeyBinding;
|
} KeyBinding;
|
||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
|
|
@ -426,6 +427,9 @@ void parse_bind_flags(const char *str, KeyBinding *kb) {
|
||||||
case 'r':
|
case 'r':
|
||||||
kb->isreleaseapply = true;
|
kb->isreleaseapply = true;
|
||||||
break;
|
break;
|
||||||
|
case 'p':
|
||||||
|
kb->ispassapply = true;
|
||||||
|
break;
|
||||||
default:
|
default:
|
||||||
// 忽略其他字符或可根据需要处理错误
|
// 忽略其他字符或可根据需要处理错误
|
||||||
break;
|
break;
|
||||||
|
|
@ -1890,7 +1894,7 @@ void parse_option(Config *config, char *key, char *value) {
|
||||||
|
|
||||||
config->exec_once_count++;
|
config->exec_once_count++;
|
||||||
|
|
||||||
} else if (regex_match("^bind[s|l|r]*$", key)) {
|
} else if (regex_match("^bind[s|l|r|p]*$", key)) {
|
||||||
config->key_bindings =
|
config->key_bindings =
|
||||||
realloc(config->key_bindings,
|
realloc(config->key_bindings,
|
||||||
(config->key_bindings_count + 1) * sizeof(KeyBinding));
|
(config->key_bindings_count + 1) * sizeof(KeyBinding));
|
||||||
|
|
|
||||||
|
|
@ -3385,7 +3385,11 @@ keybinding(uint32_t state, bool locked, uint32_t mods, xkb_keysym_t sym,
|
||||||
k->func) {
|
k->func) {
|
||||||
|
|
||||||
isbreak = k->func(&k->arg);
|
isbreak = k->func(&k->arg);
|
||||||
handled = 1;
|
|
||||||
|
if (!k->ispassapply)
|
||||||
|
handled = 1;
|
||||||
|
else
|
||||||
|
handled = 0;
|
||||||
|
|
||||||
if (isbreak)
|
if (isbreak)
|
||||||
break;
|
break;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue