mirror of
https://github.com/ckb-next/ckb-next.git
synced 2026-10-10 12:27:21 -04:00
daemon: input, keymap - Vacant keymap slot 129
Move "ctrlwheelcw" to another place to make room for scan code 129. Potentially this creates another conflict for a currently unhandled scancode.
This commit is contained in:
+1
-1
@@ -12,7 +12,7 @@
|
||||
#define IS_VOLWHEEL(scan) (((scan) == KEY_VOLUMEUP || (scan) == KEY_VOLUMEDOWN) && DEV_HAS_VOLWHEEL(kb))
|
||||
// Lookup control wheel events by index in keymap. Alternatively one could check for non-null key->name to start with "ctrlwheel".
|
||||
// FIXME: Replace by proper lookup of map in keymap.
|
||||
#define IS_CTRLWHEEL(kb, index) ((kb)->protocol == PROTO_BRAGI && ((index) == 129 || (index) == 130))
|
||||
#define IS_CTRLWHEEL(kb, index) ((kb)->protocol == PROTO_BRAGI && ((index) == 116 || (index) == 130))
|
||||
|
||||
static int macromask(const uchar* keys, const uchar* macro){
|
||||
// Scan a macro against key input. Return 0 if any of them don't match
|
||||
|
||||
+4
-4
@@ -442,7 +442,7 @@ const key keymap_bragi[N_KEYS_BRAGI_PATCH] = {
|
||||
{ "light", 113, KEY_CORSAIR },
|
||||
{ "lock", 1, KEY_CORSAIR },
|
||||
{ "ro", 115, KEY_RO },
|
||||
{ 0, -1, KEY_NONE },
|
||||
{ "ctrlwheelcw", -1, KEY_CORSAIR },
|
||||
{ 0, -1, KEY_NONE },
|
||||
{ 0, -1, KEY_NONE },
|
||||
{ 0, -1, KEY_NONE },
|
||||
@@ -455,7 +455,7 @@ const key keymap_bragi[N_KEYS_BRAGI_PATCH] = {
|
||||
{ "prev", 126, KEY_PREVIOUSSONG },
|
||||
{ "mr", -1, KEY_CORSAIR },
|
||||
{ "profswitch", 128, KEY_CORSAIR },
|
||||
{ "ctrlwheelcw", -1, KEY_CORSAIR },
|
||||
{ 0, -1, KEY_NONE },
|
||||
{ "ctrlwheelccw", -1, KEY_CORSAIR },
|
||||
{ "g1", 131, KEY_CORSAIR },
|
||||
{ "g2", 132, KEY_CORSAIR },
|
||||
@@ -901,7 +901,7 @@ void process_input_urb(void* context, unsigned char* buffer, int urblen, ushort
|
||||
// Always clear the control wheel key bits.
|
||||
// This will enable the daemon to emulate keyup events in inputupdate_keys().
|
||||
if (DEV_HAS_CTRLWHEEL(kb)) {
|
||||
CLEAR_KEYBIT(targetkb->input.keys, 129);
|
||||
CLEAR_KEYBIT(targetkb->input.keys, 116);
|
||||
CLEAR_KEYBIT(targetkb->input.keys, 130);
|
||||
}
|
||||
|
||||
@@ -918,7 +918,7 @@ void process_input_urb(void* context, unsigned char* buffer, int urblen, ushort
|
||||
memcpy(&wheel, buffer + 4, sizeof(int32_t));
|
||||
if(wheel > 0) {
|
||||
// Apply fresh key data: clockwise rotation
|
||||
SET_KEYBIT(targetkb->input.keys, 129);
|
||||
SET_KEYBIT(targetkb->input.keys, 116);
|
||||
} else {
|
||||
// Apply fresh key data: counter-clockwise rotation
|
||||
SET_KEYBIT(targetkb->input.keys, 130);
|
||||
|
||||
Reference in New Issue
Block a user