[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: How to use stateful keys to switch keyboard layouts? (was: utilizing the Scroll key)



On Mon, 21 Mar 2011 23:35:24 +0100, lee wrote:

> On Sun, Mar 20, 2011 at 03:38:58PM +0000, Camaleón wrote:

>> Last time I checked, under an X environment the "scroll lock" key is
>> disabled (you can toggle the light on/off if you go to a tty, though).
> 
> Since xev recognizes it just fine as Scroll_Lock, this key doesn´t seem
> to be disabled. That it doesn´t do anything makes it a good choice for
> giving it a custum function :)

Yes, the key can be used but the led light is off in X by default :-)

>> lock one). I think the comma or period is written based on the keyboard
>> layout map which uses different decimal mark separators,
> 
> Yes --- in my case, the default would be to have a comma on the Del-key
> of the numpad. I´ve changed it in my ~/.Xmodmap to a period because I
> need the period much more often than a comma.
> 
> Now a fixed setting has turned out to be inconvenient because there are
> cases where I need a period on this key and others where I need a comma.
> To make things worse, there´s also buggy software ignoring the fact that
> this key yields a period instead of a comma.

Hum... true is that I'm more used to press the separated period and comma 
keys of the keyboard, not the one located at the num pad nor switching 
between them. 

>> so I guess that switching between two of them (one that uses the period
>> and other that uses the comma) you could get the same behaviour
>> although having to swap the complete keyboard layout seems a bit
>> overwhelming :-?
> 
> It won´t take swapping the whole keyboard layout, you can switch keys
> individually. The problem is to make the scroll key do that ...
>
> The idea of keys having states isn´t at all new to the system. Just
> think of the (obsolete) Caps_Lock (wich is Ctrl with my layout), and of
> the Num_Lock key.
> 
> Scroll_Lock by itself is a key that does have a state, same as Num_Lock.
> Where´s/what´s the mechnism behind keys that have states? Can´t I use
> that mechnism to change what a single key does? Num_Lock, for example,
> does it for a number of keys.

Well, at least in Gnome you can use the scroll lock key to trigger 
predefined actions (launch applications, scripts, etc...) or customized 
ones. But I'm now reading that you already made a script to toggle on/off 
this, good :-)

> Now think of people who type in different languages and need very
> different keyboard layouts for that. Their typing might be a little
> easier if they could switch layouts just by pressing Scroll_Lock, and
> they could even see from the LED on their keyboard which layout is
> currently active. They could easily have four layouts with LED
> indication, utilizing Scroll_Lock and Caps_Lock to switch --- more when
> you include Num_Lock. I´d be suprised if I was the first one to come up
> with this idea ...

Switching between two keyboard layouts using the scroll key could be 
feasible (provided there are only 2 states for the key -on/off- I think 
this could be useful for just 2 languages... or 2 actions). But there is 
also a dedicated applet for that task. And remember that the scroll key 
has still its use when you are in a tty ;-)

Greetings,

-- 
Camaleón


Reply to: