On Fri, 12 Jul 2013 01:08:03 +0200
lee <[email protected]> wrote:

> Mateusz Poszwa <[email protected]> writes:
> 
> > On Sun, 07 Jul 2013 05:29:03 +0200
> > lee <[email protected]> wrote:
> >
> >> Hi,
> >> 
> >> what might be the reason for the following key bindings in the config to
> >> be ignored:
> >> 
> >> 
> >> bind $mod+periodcentered workspace next
> >> bind $mod+Shift+abovedot workspace prev
> >> 
> >> 
> >> $mod is AltGr, and I have
> >> 
> >> 
> >> keycode  61 = minus underscore minus underscore periodcentered abovedot 
> >> periodcentered
> >> 
> >> 
> >> in my xmodmap.  I can type these symbols just fine, as if i3 is totally
> >> ignoring these key bindings.
> >
> > I'd try with:
> > „
> > bindsym $mod+minus workspace next
> > bindsym $mod+Shift+minus workspace prev
> > ”
> > in this case.
> 
> Oh thank you!  That works perfectly!
> 
> My understanding was that you need to use the actual key symbol (as used
> in xmodmap) that is being produced.  For example, when you have
> 
> bindsym $mod+Shift+J move left
> 
> a capital 'J' is being produced.  When you have the some binding without
> Shift, like
> 
> bindsym $mod+j move left
> 
> it's a small 'j' because Shift isn't pressed.

„
bindsym $mod+Shift+j move left
”
would work too. Maybe the names are case insensitive?


> This shows throughout the default configuration file.  The documentation
> says:
> 
> 
> ,---- [ http://i3wm.org/docs/userguide.html#keybindings]
> |
> | A keysym (key symbol) is a description for a specific symbol, like "a"
> | or "b", but also more strange ones like "underscore" instead of
> | "_". These are the ones you use in Xmodmap to remap your keys. To get
> | the current mapping of your keys, use xmodmap -pke. To interactively
> | enter a key and see what keysym it is configured to, use xev.
> |
> `----
> 
> 
> I have been using xev to verify that pressing 'AltGr+<Minus Key>' and
> 'AltGr+Shift+<Minus Key>' do yield 'periodcentered' and 'abovedot',
> respectively.  (Those are now intercepted by i3.)

I don't think so, but I may be wrong.
If it was as you say, you could write
„
bindsym abovedot workspace prev
”
instead of
„
bindsym $mod+Shift+minus workspace prev
”
To be honest, I haven't checked if the former works.
You can do it as an exercise and let me know if you succeed. ;-)
I'd be surprised, but I don't say it's impossible.

> Actually, 'Shift+<Minus Key>' produces an underscore.  How come that
> 'AltGr+Shift+minus' even works?  Shouldn't that rather be
> 'AltGr+Shift+underscore'?[1]

I think i3 maps keysyms („plain” keysyms — without modifiers)
to keycodes and applies modifiers itself.


> Is the documentation misleading, or is there some inconsistency with how
> i3 perceives (some) keystrokes or key symbols?
> 
> 
> [1]:
> KeyRelease event, serial 27, synthetic NO, window 0x1e00001,
>     root 0x2a5, subw 0x0, time 93058061, (280,163), root:(1152,655),
>     state 0x10, keycode 61 (keysym 0x2d, minus), same_screen YES,
>     XLookupString gives 1 bytes: (2d) "-"
>     XFilterEvent returns: False
> 
> keycode  61 = minus underscore minus underscore periodcentered abovedot 
> periodcentered
> 
> 
> > As a side note, I don't think using AltGr as a modifier is a good idea…
> 
> How come you think so?  It works great and allows for some easy
> one-handed i3-operations.  Since I have modified my xmodmap so that I
> can type braces and brackets without pressing AltGr, there are only four
> keys that come to mind for which I need AltGr: '@', '|', 'ß' and '\'.
> That leaves me pretty much all of the other 98 keys to bind i3 stuff to
> :)  Do you know of any application which would be aware that there's such
> a thing as an AltGr key?

How about 'ö'? ;-P
You are right. It seems good in you case.
I use the Colemak keyboard layout, which uses AltGr heavily
for diacritics input, and there's quite many of them in Polish.

As for AltGr-aware applications, probably
some old games may use that key.

> (I'm using a Model M keyboard that doesn't have the obsolete keys newer
> ones have, so there aren't any keys around Space, Alt, AltGr and Ctrl
> that would get persistently in the way.)

I have plenty of „obsolete” keys on my TypeMatrix 2020,
such as Super (captioned „Start”), which I use for i3's bindings,
or Caps Lock, which I have bound a minus to. ;-)

-- 
Mateusz Poszwa

Reply via email to