LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   keyb layout switch on lock state possible? (https://www.linuxquestions.org/questions/linux-newbie-8/keyb-layout-switch-on-lock-state-possible-4175507942/)

tuxboom747 06-13-2014 08:27 AM

keyb layout switch on lock state possible?
 
hello all I fiddled with tools like xmodmap, xbindkeys and set up my own keyboard layout map. Now I'm realy tired experimenting, so maybe it's impossible what I want! Please can someone bring me up again or tell me it is utopia! Thanks in advance! What I want is the following: I have an us KB layout for using scripting the bash(1) and love it for everyday usage. Sometimes I want to write something in my native german language and therfore dreamed about this: On the US KB layout the keys "squarebracket open", "semicolon" and "apostrophe" are the {u,o,a}diaeresis (german umlauts) keys respectively. I want that theese three keys switch to print diaeresis characters WHEN Scroll_Lock is active and print US layout when Scroll_Lock is inactive. I'm stupid or what do you mean, please? [Debian 7.4 on APU A6, 16GB, NVidia GT 640]

cepheus11 06-13-2014 09:03 AM

What desktop environment are you using?

tuxboom747 06-13-2014 09:07 AM

Quote:

Originally Posted by cepheus11 (Post 5187589)
What desktop environment are you using?

xfce4, from the debian stable repo :)

cepheus11 06-13-2014 10:08 AM

I'm no XFCE expert, but maybe they provide something very similar: A configurable keyboard layout list and a global hotkey to toggle between the layouts in this list. You could then populate the list with "de" and "en" layouts, and assign ScrollLock to the toggle function. It would not be ScrollLock-state based like you described, but everytime you press ScrollLock, the layout is switched. Works in KDE.

DavidMcCann 06-13-2014 11:52 AM

Add the keyboard layout applet to the panel. Then you can set up everything you need by right-clicking on it.

tuxboom747 06-13-2014 12:02 PM

Quote:

Originally Posted by cepheus11 (Post 5187627)
I'm no XFCE expert, but maybe they provide something very similar: A configurable keyboard layout list and a global hotkey to toggle between the layouts in this list. You could then populate the list with "de" and "en" layouts, and assign ScrollLock to the toggle function. It would not be ScrollLock-state based like you described, but everytime you press ScrollLock, the layout is switched. Works in KDE.

Thank you, but that's not want I want. I want to stay with the US layout and switching three keys to have the german umlauts present. The whole rest of the layout stays US.

tuxboom747 06-13-2014 12:07 PM

Quote:

Originally Posted by DavidMcCann (Post 5187668)
Add the keyboard layout applet to the panel. Then you can set up everything you need by right-clicking on it.

Maybe I don't understand: The xfce4-keyboard applet switches complete layouts, eg. de and us. I want to stay with the US layout, and have ONLY switched the three keys providing the german umlauts! However, Thank you!

tuxboom747 06-13-2014 12:18 PM

To make it (hopefully) clear: Can someone tell me how to code in MY OWN keyboard layout something like: if CapsLock is active, then swicht keys alpha,beta,gamma to provide german umlauts if CapsLock is off, then switch keys alpha,beta,gamma back to provide normal US characters "squarebracket open", "semicolon" and "apostrophe" so I have only one keyboard layout and can switch three keys by simply turning CapsLock on and off. Thanks in advance!

DavidMcCann 06-14-2014 11:06 AM

Now I understand! But I don't think you can do it. If you look at the drivers in /usr/share/X11/xkb/symbols, you can see that each key can have four levels:
1: by itself
2: with Shift
3: with ISO_Level3_Shift
4: with Shift and ISO_Level3_Shift

The Caps_Lock can be used to lock the input to interpreting every key as if Shift had been pressed, or to replacing every letter with the capital version, but these are built-in features. You need one to interpret every key as if Level3_Shift had been pressed, and that hasn't been written.

Your best option is probably to create a layout identical to "us" but with the umlauted letters on three keys you don't need, then save that as "de". Then you can switch layouts ty type in German, but keep the familiar positions for things like the hyphen and parentheses. Alternatively, alter the US driver to give you umlauted letters on levels 3 and 4: then you can get "ä" with AltGr+a.

tuxboom747 06-15-2014 02:16 PM

Thank you, DavidMcCann!
I allways made my own layout called "de_us" and installed it from the /usr/share/X11/xkb/symbols/de_us as an symlink to my $HOME de_us exacly as you descriped with AltGr+[Shift+]+diaeresis on the {a,u,o}keys respectively! I wondered if there is a simpler way to get umlauts without having to use AltGr but as the other keys by "switching" an indicator on (Scroll_Lock) and the driver would know to interprete some keys other than "normal".

So, I learned: "You Can't Always Get What You Want"

Thanks!


All times are GMT -5. The time now is 07:27 PM.