Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Hardcode the Mode_switch modifier as Mod5 #307

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions src/parse.c
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
#include "parse.h"

xcb_keysym_t Alt_L, Alt_R, Super_L, Super_R, Hyper_L, Hyper_R,
Meta_L, Meta_R, Mode_switch, Num_Lock, Scroll_Lock;
Meta_L, Meta_R, Num_Lock, Scroll_Lock;

keysym_dict_t nks_dict[] = {/*{{{*/
{"VoidSymbol" , 0xffffff} ,
Expand Down Expand Up @@ -2744,7 +2744,7 @@ bool parse_modifier(char *name, uint16_t *modfield)
*modfield |= (modfield_from_keysym(Meta_L) | modfield_from_keysym(Meta_R));
return true;
} else if (strcmp(name, "mode_switch") == 0) {
*modfield |= modfield_from_keysym(Mode_switch);
*modfield |= XCB_MOD_MASK_5;
return true;
} else if (strcmp(name, "mod1") == 0) {
*modfield |= XCB_MOD_MASK_1;
Expand Down Expand Up @@ -2802,7 +2802,6 @@ void get_standard_keysyms(void)
GETKS(Super_R)
GETKS(Hyper_L)
GETKS(Hyper_R)
GETKS(Mode_switch)
GETKS(Num_Lock)
GETKS(Scroll_Lock)
#undef GETKS
Expand Down
2 changes: 1 addition & 1 deletion src/types.c
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ chord_t *make_chord(xcb_keysym_t keysym, xcb_button_t button, uint16_t modfield,
for (unsigned char col = 0; col < KEYSYMS_PER_KEYCODE; col++) {
xcb_keysym_t ks = xcb_key_symbols_get_keysym(symbols, *kc, col);
if (ks == keysym) {
uint16_t implicit_modfield = (col & 1 ? XCB_MOD_MASK_SHIFT : 0) | (col & 2 ? modfield_from_keysym(Mode_switch) : 0);
uint16_t implicit_modfield = (col & 1 ? XCB_MOD_MASK_SHIFT : 0) | (col & 2 ? XCB_MOD_MASK_5 : 0);
uint16_t explicit_modfield = modfield | implicit_modfield;
chord = malloc(sizeof(chord_t));
bool unique = true;
Expand Down
2 changes: 0 additions & 2 deletions src/types.h
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,6 @@
#define ESCAPE_KEYSYM 0xff1b
#define SYNCHRONOUS_CHAR ';'

extern xcb_keysym_t Mode_switch;

typedef struct chord_t chord_t;
struct chord_t {
char repr[MAXLEN];
Expand Down