
Hello I've submitted a bug some time ago. I didn't get any response, so I'm reposing it to ML. http://code.google.com/p/xmonad/issues/detail?id=295 Submap actions don't work when in russian layout. In english layout it does work without problem. Standard xmonad key bindings work in both layouts. I'm using version from darcs. 0.8 is affected to AFAIR. Layout are set up with XCB. $ setxkbmap -model pc104 -layout us,ru -variant basic,winkeys $ setxkbmap -option -option \ "grp_led:scroll,grp:shifts_toggle,compose:menu,ctrl:nocaps" Below is snippet from X.A.Submap. Quick research shown that keymasks m and m' has bit (1<<13) set when russian layout chosen. I have no idea how to interpret it. All valid keymasks are <= (1<<12) as declared in X11 headers.
-- | Like 'submap', but executes a default action if the key did not match. submapDefault :: X () -> M.Map (KeyMask, KeySym) (X ()) -> X () submapDefault def keys = do XConf { theRoot = root, display = d } <- ask
io $ grabKeyboard d root False grabModeAsync grabModeAsync currentTime
(m, s) <- io $ allocaXEvent $ \p -> fix $ \nextkey -> do maskEvent d keyPressMask p KeyEvent { ev_keycode = code, ev_state = m } <- getEvent p keysym <- keycodeToKeysym d code 0 if isModifierKey keysym then nextkey else return (m, keysym)
m' <- cleanMask m
maybe def id (M.lookup (m', s) keys)
io $ ungrabKeyboard d currentTime
-- Khudyakov Alexey

On Jun 19, 2009, at 06:27 , Khudyakov Alexey wrote:
Below is snippet from X.A.Submap. Quick research shown that keymasks m and m' has bit (1<<13) set when russian layout chosen. I have no idea how to interpret it. All valid keymasks are <= (1<<12) as declared in X11 headers.
According to X11/extensions/XKB.h, modifier mask bits starting at (1<<13) indicate group state. (See XkbBuildCoreState() which builds an event value when Xkb is active.) I *think* you want this; while I don't know the Russian keyboard layout, xmonad's default key bindings are less than mnemonic if you're using the Hebrew or Arabic layouts :) so you may want to define a separate, mnemonic key mapping for use in Russian. (The flip side of this is if you change the group number the Russian layout maps to, you need to make the same change to your xmonad key bindings; this strikes me as bad.) -- brandon s. allbery [solaris,freebsd,perl,pugs,haskell] allbery@kf8nh.com system administrator [openafs,heimdal,too many hats] allbery@ece.cmu.edu electrical and computer engineering, carnegie mellon university KF8NH

On Суббота 20 июня 2009 07:37:03 you wrote:
According to X11/extensions/XKB.h, modifier mask bits starting at (1<<13) indicate group state. (See XkbBuildCoreState() which builds an event value when Xkb is active.) I think you want this; while I don't know the Russian keyboard layout, xmonad's default key bindings are less than mnemonic if you're using the Hebrew or Arabic layouts :) so you may want to define a separate, mnemonic key mapping for use in Russian.
(The flip side of this is if you change the group number the Russian layout maps to, you need to make the same change to your xmonad key bindings; this strikes me as bad.)
I think key binding should work regardless of current layout. At least normal (not Submap based) key bindings works this way. So masks >= (1<<13) should be filtered out. I'm not sure where groupmasks should be stripped. It's possible either in xmonad's core function 'cleanMask' or in Submap itself. I coded latter variant and it works.

On Суббота 20 июня 2009 12:59:02 Khudyakov Alexey wrote:
On Суббота 20 июня 2009 07:37:03 you wrote:
According to X11/extensions/XKB.h, modifier mask bits starting at (1<<13) indicate group state. (See XkbBuildCoreState() which builds an event value when Xkb is active.) I think you want this; while I don't know the Russian keyboard layout, xmonad's default key bindings are less than mnemonic if you're using the Hebrew or Arabic layouts :) so you may want to define a separate, mnemonic key mapping for use in Russian.
(The flip side of this is if you change the group number the Russian layout maps to, you need to make the same change to your xmonad key bindings; this strikes me as bad.)
I think key binding should work regardless of current layout. At least normal (not Submap based) key bindings works this way.
So masks >= (1<<13) should be filtered out. I'm not sure where groupmasks should be stripped. It's possible either in xmonad's core function 'cleanMask' or in Submap itself. I coded latter variant and it works.
Here is patch which fixes Submap. * Clean Xkb masks in X.A.Submap Xkb adds its own mask and prevent Submap keybindings from normal functioning when alternate layout is used. This patch cleans these masks.

On Tue, Jun 23, 2009 at 08:58:04PM +0400, Khudyakov Alexey wrote:
On Суббота 20 июня 2009 12:59:02 Khudyakov Alexey wrote:
On Суббота 20 июня 2009 07:37:03 you wrote:
According to X11/extensions/XKB.h, modifier mask bits starting at (1<<13) indicate group state. (See XkbBuildCoreState() which builds an event value when Xkb is active.) I think you want this; while I don't know the Russian keyboard layout, xmonad's default key bindings are less than mnemonic if you're using the Hebrew or Arabic layouts :) so you may want to define a separate, mnemonic key mapping for use in Russian.
(The flip side of this is if you change the group number the Russian layout maps to, you need to make the same change to your xmonad key bindings; this strikes me as bad.)
I think key binding should work regardless of current layout. At least normal (not Submap based) key bindings works this way.
So masks >= (1<<13) should be filtered out. I'm not sure where groupmasks should be stripped. It's possible either in xmonad's core function 'cleanMask' or in Submap itself. I coded latter variant and it works.
Here is patch which fixes Submap.
* Clean Xkb masks in X.A.Submap
Xkb adds its own mask and prevent Submap keybindings from normal functioning when alternate layout is used. This patch cleans these masks.
Applied, thanks!

On Воскресенье 26 июля 2009 20:25:49 Brent Yorgey wrote:
On Tue, Jun 23, 2009 at 08:58:04PM +0400, Khudyakov Alexey wrote:
On Суббота 20 июня 2009 12:59:02 Khudyakov Alexey wrote:
On Суббота 20 июня 2009 07:37:03 you wrote:
According to X11/extensions/XKB.h, modifier mask bits starting at (1<<13) indicate group state. (See XkbBuildCoreState() which builds an event value when Xkb is active.) I think you want this; while I don't know the Russian keyboard layout, xmonad's default key bindings are less than mnemonic if you're using the Hebrew or Arabic layouts :) so you may want to define a separate, mnemonic key mapping for use in Russian.
(The flip side of this is if you change the group number the Russian layout maps to, you need to make the same change to your xmonad key bindings; this strikes me as bad.)
I think key binding should work regardless of current layout. At least normal (not Submap based) key bindings works this way.
So masks >= (1<<13) should be filtered out. I'm not sure where groupmasks should be stripped. It's possible either in xmonad's core function 'cleanMask' or in Submap itself. I coded latter variant and it works.
Here is patch which fixes Submap.
* Clean Xkb masks in X.A.Submap
Xkb adds its own mask and prevent Submap keybindings from normal functioning when alternate layout is used. This patch cleans these masks.
Applied, thanks!
BTW this patch fixes issue 295.

On Thu, Aug 06, 2009 at 01:16:08AM +0400, Khudyakov Alexey wrote:
On Воскресенье 26 июля 2009 20:25:49 Brent Yorgey wrote:
On Tue, Jun 23, 2009 at 08:58:04PM +0400, Khudyakov Alexey wrote:
On Суббота 20 июня 2009 12:59:02 Khudyakov Alexey wrote:
On Суббота 20 июня 2009 07:37:03 you wrote:
According to X11/extensions/XKB.h, modifier mask bits starting at (1<<13) indicate group state. (See XkbBuildCoreState() which builds an event value when Xkb is active.) I think you want this; while I don't know the Russian keyboard layout, xmonad's default key bindings are less than mnemonic if you're using the Hebrew or Arabic layouts :) so you may want to define a separate, mnemonic key mapping for use in Russian.
(The flip side of this is if you change the group number the Russian layout maps to, you need to make the same change to your xmonad key bindings; this strikes me as bad.)
I think key binding should work regardless of current layout. At least normal (not Submap based) key bindings works this way.
So masks >= (1<<13) should be filtered out. I'm not sure where groupmasks should be stripped. It's possible either in xmonad's core function 'cleanMask' or in Submap itself. I coded latter variant and it works.
Here is patch which fixes Submap.
* Clean Xkb masks in X.A.Submap
Xkb adds its own mask and prevent Submap keybindings from normal functioning when alternate layout is used. This patch cleans these masks.
Applied, thanks!
BTW this patch fixes issue 295.
OK, thanks, I've closed it. -Brent
participants (3)
-
Brandon S. Allbery KF8NH
-
Brent Yorgey
-
Khudyakov Alexey