I have changed the definition of Mod1 via xmodmap to not include ALT_R (to understand why scroll to the bottom). The current layout of the modifiers is below. Despite ALT_R not participating in the definition of mod1, recordings produced by xev show that the KeyEvent.state is set to mod1Mask (defined as 8 in /usr/include/X11/X.h) when either Alt key is pressed.If xmodmask says that ALT_R is not mod1, why is X reporting ALT_R+f as if it was?xmodmap:  up to 4 keys per modifier, (keycodes in parentheses):shift       Shift_L (0x32),  Shift_R (0x3e)lock        Caps_Lock (0x42)control     Control_L (0x25),  Control_R (0x69)mod1        Alt_L (0x40),  Meta_L (0xcd)mod2        Num_Lock (0x4d)mod3      mod4        Super_L (0x85),  Super_R (0x86),  Super_L (0xce),  Hyper_L (0xcf)mod5        ISO_Level3_Shift (0x5c),  Mode_switch (0xcb)The following sequence is ALT_L+f followed by ALT_R+f.KeyPress event, serial 32, synthetic NO, window 0x1000001,    root 0xc0, subw 0x0, time 4126632, (85,488), root:(86,489),    state 0x0, keycode 64 (keysym 0xffe9, Alt_L), same_screen YES,    XLookupString gives 0 bytes:     XmbLookupString gives 0 bytes:     XFilterEvent returns: FalseKeyPress event, serial 32, synthetic NO, window 0x1000001,    root 0xc0, subw 0x0, time 4126850, (85,488), root:(86,489),    state 0x8, keycode 41 (keysym 0x66, f), same_screen YES,    XLookupString gives 1 bytes: (66) f    XmbLookupString gives 1 bytes: (66) f    XFilterEvent returns: FalseKeyRelease event, serial 32, synthetic NO, window 0x1000001,    root 0xc0, subw 0x0, time 4126930, (85,488), root:(86,489),    state 0x8, keycode 64 (keysym 0xffe9, Alt_L), same_screen YES,    XLookupString gives 0 bytes:     XFilterEvent returns: FalseKeyRelease event, serial 32, synthetic NO, window 0x1000001,    root 0xc0, subw 0x0, time 4126969, (85,488), root:(86,489),    state 0x0, keycode 41 (keysym 0x66, f), same_screen YES,    XLookupString gives 1 bytes: (66) f    XFilterEvent returns: FalseKeyPress event, serial 32, synthetic NO, window 0x1000001,    root 0xc0, subw 0x0, time 4127907, (85,488), root:(86,489),    state 0x0, keycode 108 (keysym 0xffea, Alt_R), same_screen YES,    XLookupString gives 0 bytes:     XmbLookupString gives 0 bytes:     XFilterEvent returns: FalseKeyPress event, serial 32, synthetic NO, window 0x1000001,    root 0xc0, subw 0x0, time 4128123, (85,488), root:(86,489),    state 0x8, keycode 41 (keysym 0x66, f), same_screen YES,    XLookupString gives 1 bytes: (66) f    XmbLookupString gives 1 bytes: (66) f    XFilterEvent returns: FalseKeyRelease event, serial 32, synthetic NO, window 0x1000001,    root 0xc0, subw 0x0, time 4128164, (85,488), root:(86,489),    state 0x8, keycode 108 (keysym 0xffea, Alt_R), same_screen YES,    XLookupString gives 0 bytes:     XFilterEvent returns: FalseKeyRelease event, serial 32, synthetic NO, window 0x1000001,    root 0xc0, subw 0x0, time 4128203, (85,488), root:(86,489),    state 0x0, keycode 41 (keysym 0x66, f), same_screen YES,    XLookupString gives 1 bytes: (66) f    XFilterEvent returns: FalseBackground:I have an application that utilizes ALT_R+ENTER to perform a function. When using this application in Xmonad, the combination Mod1+ENTER triggers the function swap the current window with the master window. By default, ALT_L and ALT_R are mapped to Mod1.In my .xinitrc, before I start Xmonad, I've altered my key map with xmodmap such that ALT_R is not part of the Mod1 definition. Despite this, Xmonad still performs the window swapping behavior when entering ALT_R+ENTER. Xmonad seems to be unaware that Mod1 no longer includes ALT_R.Here is my .xinitrc# Java's GUI can't handle some non-reparenting window managers like# Xmonad without being told how to behaveexport _JAVA_AWT_WM_NONREPARENTING=1# The right Alt key is useful in IntelliJ, tell Xmonad to ignore itxmodmap ~/.Xmodmap# Start XmonadxmonadHere is the output of xmodmap after Xmonad starts is above.I've recorded the sequence with xev and confirmed that the ENTER is never registered. Instead, several FocusIn/FocusOut events occur after the ALT_R is recorded.KeyPress event, serial 32, synthetic NO, window 0x1200001,    root 0xc0, subw 0x0, time 1432589, (92,374), root:(93,375),    state 0x0, keycode 108 (keysym 0xffea, Alt_R), same_screen YES,    XLookupString gives 0 bytes:     XmbLookupString gives 0 bytes:     XFilterEvent returns: FalseFocusOut event, serial 32, synthetic NO, window 0x1200001,    mode NotifyGrab, detail NotifyAncestorPropertyNotify event, serial 32, synthetic NO, window 0x1200001,    atom 0x155 (WM_STATE), time 1433760, state PropertyNewValueFocusOut event, serial 32, synthetic NO, window 0x1200001,    mode NotifyUngrab, detail NotifyPointerFocusIn event, serial 32, synthetic NO, window 0x1200001,    mode NotifyUngrab, detail NotifyAncestorKeymapNotify event, serial 32, synthetic NO, window 0x0,    keys:  0   0   0   0   0   0   0   0   0   0   0   0   0   16  0   0              0   0   0   0   0   0   0   0   0   0   0   0   0   0   0   0   KeyRelease event, serial 32, synthetic NO, window 0x1200001,    root 0xc0, subw 0x0, time 1434117, (92,374), root:(93,375),    state 0x8, keycode 108 (keysym 0xffea, Alt_R), same_screen YES,    XLookupString gives 0 bytes:     XFilterEvent returns: False
Why isn't X treating ALT_L and ALT_R differently w/r/t Mod1
x11;keyboard shortcuts;xmodmap