Skip to content

Commit

Permalink
Fix keybindings for selecting/solo/etc. track which uses CAPS, plus f…
Browse files Browse the repository at this point in the history
…ix CAPS key on X11
  • Loading branch information
kmatheussen committed Apr 14, 2016
1 parent 29b2326 commit 15b9990
Show file tree
Hide file tree
Showing 5 changed files with 1,444 additions and 1,437 deletions.
2 changes: 1 addition & 1 deletion Qt/Qt_Main.cpp
Expand Up @@ -155,7 +155,7 @@ static void set_keyswitch(void){
#else
static void set_keyswitch(void){
static int keynumswitch[]={
EVENT_CTRL_L, EVENT_SHIFT_L,EVENT_CAPS,
EVENT_CTRL_L, EVENT_SHIFT_L, EVENT_CAPS,
EVENT_EXTRA_L,EVENT_ALT_L,EVENT_ALT_R,
EVENT_EXTRA_R, EVENT_CTRL_R, EVENT_SHIFT_R
};
Expand Down
11 changes: 9 additions & 2 deletions X11/X11_keyboard.c
Expand Up @@ -200,10 +200,12 @@ static void init_keynums(XEvent *event){

static int get_modifier(KeySym keysym){
# define S(X11_VAL, EVENT_VAL) case XK_##X11_VAL: return EVENT_##EVENT_VAL;


//printf("keysum: %d, caps_lock: %d\n",(int)keysym,XK_Caps_Lock);
switch(keysym){
S(Control_L, CTRL_L);
S(Control_R, CTRL_R);
S(Caps_Lock, CAPS);
S(Shift_L, SHIFT_L);
S(Shift_R, SHIFT_R);
S(Alt_L, ALT_L);
Expand All @@ -223,7 +225,12 @@ int OS_SYSTEM_get_modifier(void *void_event){

//KeySym keysym = (KeySym)virtualkey;

return get_modifier(keysym);
int ret = get_modifier(keysym);

if (ret==EVENT_NO && get_subID_from_scancode(OS_SYSTEM_get_keycode(void_event))==EVENT_CAPS) // caps lock key doesn't map to XK_Caps_Lock on my keyboard.
return EVENT_CAPS;

return ret;
}

int OS_SYSTEM_get_keynum(void *event){
Expand Down

0 comments on commit 15b9990

Please sign in to comment.