LinuxQuestions.org
Latest LQ Deal: Linux Power User Bundle
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 06-13-2014, 08:27 AM   #1
tuxboom747
LQ Newbie
 
Registered: May 2011
Posts: 19

Rep: Reputation: 10
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]

Last edited by tuxboom747; 06-13-2014 at 08:29 AM.
 
Old 06-13-2014, 09:03 AM   #2
cepheus11
Member
 
Registered: Nov 2010
Location: Germany
Distribution: Gentoo
Posts: 276

Rep: Reputation: 86
What desktop environment are you using?
 
Old 06-13-2014, 09:07 AM   #3
tuxboom747
LQ Newbie
 
Registered: May 2011
Posts: 19

Original Poster
Rep: Reputation: 10
Quote:
Originally Posted by cepheus11 View Post
What desktop environment are you using?
xfce4, from the debian stable repo
 
Old 06-13-2014, 10:08 AM   #4
cepheus11
Member
 
Registered: Nov 2010
Location: Germany
Distribution: Gentoo
Posts: 276

Rep: Reputation: 86
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.
 
Old 06-13-2014, 11:52 AM   #5
DavidMcCann
Senior Member
 
Registered: Jul 2006
Location: London
Distribution: CentOS, Salix
Posts: 4,345

Rep: Reputation: 1316Reputation: 1316Reputation: 1316Reputation: 1316Reputation: 1316Reputation: 1316Reputation: 1316Reputation: 1316Reputation: 1316Reputation: 1316
Add the keyboard layout applet to the panel. Then you can set up everything you need by right-clicking on it.
 
Old 06-13-2014, 12:02 PM   #6
tuxboom747
LQ Newbie
 
Registered: May 2011
Posts: 19

Original Poster
Rep: Reputation: 10
Quote:
Originally Posted by cepheus11 View Post
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.
 
Old 06-13-2014, 12:07 PM   #7
tuxboom747
LQ Newbie
 
Registered: May 2011
Posts: 19

Original Poster
Rep: Reputation: 10
Quote:
Originally Posted by DavidMcCann View Post
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!

Last edited by tuxboom747; 06-13-2014 at 12:20 PM.
 
Old 06-13-2014, 12:18 PM   #8
tuxboom747
LQ Newbie
 
Registered: May 2011
Posts: 19

Original Poster
Rep: Reputation: 10
Red face

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!
 
Old 06-14-2014, 11:06 AM   #9
DavidMcCann
Senior Member
 
Registered: Jul 2006
Location: London
Distribution: CentOS, Salix
Posts: 4,345

Rep: Reputation: 1316Reputation: 1316Reputation: 1316Reputation: 1316Reputation: 1316Reputation: 1316Reputation: 1316Reputation: 1316Reputation: 1316Reputation: 1316
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.
 
1 members found this post helpful.
Old 06-15-2014, 02:16 PM   #10
tuxboom747
LQ Newbie
 
Registered: May 2011
Posts: 19

Original Poster
Rep: Reputation: 10
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!
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
deian yum lock [ ERR] Reading state information E: Could not get lock /var/lock/aptit jayakumar01 Linux - Server 1 12-05-2011 11:26 AM
Disable lock session (lock screen) when switch user in KDE 4.x Murz Linux - Desktop 4 12-01-2010 08:28 AM
keyboart layout switch MI neo_cool_XIIK Fedora 3 12-29-2004 12:33 PM
How do i switch keyboard layout in Gnome? z-vet Linux - Newbie 1 10-15-2004 05:02 AM
KDE 3.1 & Keyb Layout ..:eMa:.. Slackware 7 09-25-2003 10:41 AM


All times are GMT -5. The time now is 04:22 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration