mirror of
https://github.com/ckb-next/ckb-next.git
synced 2026-10-10 12:27:21 -04:00
Fix adressing wrong pipe and g-key + modifiers
When adressing a command pipe for the mouse with a macro cmd, the daemon got a null-ptr, because no macro functions are defined yet. This fixes that effect. Using "macro [<modifier>\+]+[<keyname>]+:<def>" is now usable, when sending the macro definition "manually" via echo to the command pipe for the keyboard.
This commit is contained in:
@@ -298,7 +298,8 @@ int readcmd(usbdevice* kb, const char* line){
|
||||
// Macros and DPI have a separate left-side handler
|
||||
if(command == MACRO || command == DPI){
|
||||
word[left] = 0;
|
||||
vt->do_macro[command](kb, mode, notifynumber, word, right);
|
||||
if (vt->do_macro[command]) vt->do_macro[command](kb, mode, notifynumber, word, right);
|
||||
else fprintf (stderr, "Got null-ptr in vt->do_cmd[MACRO]. Did you try to send a macro to mouse (maybe wrong cmd-pipe)?\n");
|
||||
continue;
|
||||
}
|
||||
// Scan the left side for key names and run the requested command
|
||||
|
||||
@@ -5,7 +5,8 @@
|
||||
int macromask(const uchar* key1, const uchar* key2){
|
||||
// Scan a macro against key input. Return 0 if any of them don't match
|
||||
for(int i = 0; i < N_KEYBYTES_INPUT; i++){
|
||||
if((key1[i] & key2[i]) != key2[i])
|
||||
// if((key1[i] & key2[i]) != key2[i])
|
||||
if(key1[i] != key2[i]) // Changed to detect G-keys + modifiers
|
||||
return 0;
|
||||
}
|
||||
return 1;
|
||||
@@ -38,7 +39,7 @@ static void inputupdate_keys(usbdevice* kb){
|
||||
if (a > 200) usleep (100);
|
||||
else if (a > 20) usleep(30);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user