You are not logged in.

#1 2010-11-25 20:51:49

DennisB
Member
Registered: 2010-11-25
Posts: 4

different input at xterm and GTK

Hi guys,
I'm leaning german, so I need to input some chars like öäüß.
When I'm in xterm with an English keyboard layout, I can input 'ß' with Alt+Shift+'-'.
But when I'm using a GTK program, there is no input with the combi.
Could I input the german chars with an english keyboard layout?
I don't wanna set a german layout and back to english, and again...
would anybody help me?

1000 thx

Offline

#2 2010-11-25 22:01:00

thisoldman
Member
From: Pittsburgh
Registered: 2009-04-25
Posts: 1,172

Re: different input at xterm and GTK

In GTK apps, if you want an umlaut to appear above the previous character, you can use a Unicode combining diacritical mark.  Type a lower-case 'o', then press Ctrl+Shift+'u' together and release ('u̲' should appear) then type '0' (zero). then '3', '0' again, ''8', and finally 'Enter'.

If I've explained it correctly, you should have this: ö.

ẞ and ß, miniscule and majuscule eszett, are Ctrl+Shift+u then 00df and Ctrl+Shift+u then 1e9e.

In general, you can print a glyph if you type Ctrl+Shift+u and then the unicode code for that glyph.  Another code for ö is 00f6.  You can find the codes for unicode glyphs easily on the internet, for example Google "o umlaut", or from the 'gucharmap' app.

Edited to fix typos.

Last edited by thisoldman (2010-11-25 22:06:54)

Offline

#3 2010-11-25 23:08:37

3])
Member
From: Netherlands
Registered: 2009-10-12
Posts: 215

Re: different input at xterm and GTK

Check:

/usr/share/kbd/keymaps/i386

Then in the terminal:

setxkbmap foo 

with  foo being the layout of choice.

You can also add this command to .xinitrc in case you do not wish to retype this daily.

EDIT: my hint wont fit your needs, just read your post more closely

Last edited by 3]) (2010-11-25 23:12:14)


“There are two ways of constructing a software design. One way is to make it so simple that there are obviously no deficiencies. And the other way is to make it so complicated that there are no obvious deficiencies.”-- C.A.R. Hoare

Offline

#4 2010-11-25 23:32:32

ferda
Member
Registered: 2010-02-05
Posts: 67

Re: different input at xterm and GTK

you could modify your keymap and remap keys with xmodmap.

I have made CapsLock an additional modkey and mapped the new level with custom characters.

https://wiki.archlinux.org/index.php/Ex … ys_in_Xorg

Last edited by ferda (2010-11-25 23:34:37)

Offline

#5 2010-11-26 12:16:44

DennisB
Member
Registered: 2010-11-25
Posts: 4

Re: different input at xterm and GTK

to thisoldman: thx, your idea is wonderful, but to input an unicode is a disturb for thoughts.

to 3]) and ferda:
Either xev or showkey can't get a keycode of 'Ü', although I can input a 'Ü' in xterm.
And I found I can input 'Ü' only in xterm(maybe rxvt is ok too), but not in a real console.
what a disaster!
So I just remap Caps as a "Toggle-Layout" hotkey...

thx all u guys

Offline

#6 2010-11-26 18:08:00

karol
Archivist
Registered: 2009-05-06
Posts: 25,440

Re: different input at xterm and GTK

Are you using those characters directly in the shell? What for? Try stick to ASCII for file and directory names.
If you need to input them in an editor, there should be a shorthand for it so that you don't have to remember the utf8 codes.

Offline

#7 2010-11-26 23:11:19

ferda
Member
Registered: 2010-02-05
Posts: 67

Re: different input at xterm and GTK

Keymaps in X and in console are completely different things.
xmodmap only effects the keymap in X.

Here is an .Xmodmap that would give you "ü" when pressing CapsLock and "u", "Ü" when pressing Caps+Shift+u and so on.

keycode 66 = Mode_switch NoSymbol Mode_switch
clear mod5
add mod5 = ISO_Level3_Shift
keycode  30 = u U udiaeresis Udiaeresis
keycode  32 = o O odiaeresis Odiaeresis
keycode  38 = a A adiaeresis Adiaeresis
keycode  39 = s S ssharp S

Maybe you would like to add ShiftLock functionality when you press both Shift keys. Sadly you can't make it emulate Caps_Lock, at least I haven't found a way.
Add this to your .Xmodmap:

keycode  50 = Shift_L Shift_Lock Shift_L 
keycode  62 = Shift_R Shift_Lock Shift_R 

Shift_Lock is released when you press Shift again.
I wrote the examples assuming that you use an US keyboard layout.

If you don't want to lose the CapsLock functionality you could as well remap keys you don't use, p.e. the navigation keys on your keypad or multimedia keys or whatever you want.

Offline

#8 2010-11-29 22:41:42

DennisB
Member
Registered: 2010-11-25
Posts: 4

Re: different input at xterm and GTK

Wonderful!!
It's what I just need!
ttttttttttthhhhhhhhhhhhhxxxxxxxxxxxxxxxxx smile

ferda wrote:

Keymaps in X and in console are completely different things.
xmodmap only effects the keymap in X.

Here is an .Xmodmap that would give you "ü" when pressing CapsLock and "u", "Ü" when pressing Caps+Shift+u and so on.

keycode 66 = Mode_switch NoSymbol Mode_switch
clear mod5
add mod5 = ISO_Level3_Shift
keycode  30 = u U udiaeresis Udiaeresis
keycode  32 = o O odiaeresis Odiaeresis
keycode  38 = a A adiaeresis Adiaeresis
keycode  39 = s S ssharp S

Maybe you would like to add ShiftLock functionality when you press both Shift keys. Sadly you can't make it emulate Caps_Lock, at least I haven't found a way.
Add this to your .Xmodmap:

keycode  50 = Shift_L Shift_Lock Shift_L 
keycode  62 = Shift_R Shift_Lock Shift_R 

Shift_Lock is released when you press Shift again.
I wrote the examples assuming that you use an US keyboard layout.

If you don't want to lose the CapsLock functionality you could as well remap keys you don't use, p.e. the navigation keys on your keypad or multimedia keys or whatever you want.

Offline

#9 2010-11-29 22:54:56

STEELBAS
Member
From: The Netherlands
Registered: 2010-01-18
Posts: 82

Re: different input at xterm and GTK

Um. I'm not sure if I understand you correctly, but isn't this also possible (and much easier, too) using the us(intl) keyboard mapping?

That way single and double quotes become modifiers: If you press a letter after pressing single/double quotes, they get an accent/Umlaut. (èéëüËÜ, etc.)

(Not sure if "modifier" is the correct term, tbh.)

The Eszett can be easily written this way by pressing alt gr+s.

This is my standard keyboard layout... It's also handy for writing French smile

Offline

#10 2010-11-30 12:12:12

DennisB
Member
Registered: 2010-11-25
Posts: 4

Re: different input at xterm and GTK

STEELBAS wrote:

That way single and double quotes become modifiers: If you press a letter after pressing single/double quotes, they get an accent/Umlaut. (èéëüËÜ, etc.)

emmm, it's interesting, and how to realize?

Offline

Board footer

Powered by FluxBB