Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Typing special characters in KDE (like žťš)
View unanswered posts
View posts from last 24 hours
View posts from last 7 days

 
Reply to topic    Gentoo Forums Forum Index Desktop Environments
View previous topic :: View next topic  
Author Message
Skyer
n00b
n00b


Joined: 21 Mar 2011
Posts: 57
Location: Europe

PostPosted: Wed Mar 23, 2011 2:47 pm    Post subject: Typing special characters in KDE (like žťš) Reply with quote

Hello,
recently, I managed to install KDE 4,6. I am international user, and I would like to be able to type characters like žľšč and so on. They are accessible through keys near backspace, however, I'd like to be able to type them with Shit+key right left to backspace+[key] combination, where output is the key I pressed with wedge (inverse of ^ character). Is there any way to make KDE behave like that?

Thanks.


Last edited by Skyer on Thu Mar 24, 2011 7:07 pm; edited 2 times in total
Back to top
View user's profile Send private message
Apheus
Guru
Guru


Joined: 12 Jul 2008
Posts: 422

PostPosted: Wed Mar 23, 2011 4:07 pm    Post subject: Reply with quote

Maybe Compose Keys can do what you want: http://en.wikipedia.org/wiki/Compose_key

An example configuration file for X (/etc/X11/xorg.conf.d/11-keyboard.conf):

Code:
Section "InputClass"
        Identifier "keyboard-all"
        Driver "evdev"
        Option "XkbLayout" "de"
        Option "XkbVariant" "nodeadkeys"
        Option "XkbOptions" "compose:rwin"
        MatchIsKeyboard "on"
EndSection


The part "XkbOptions" "compose:rwin" tells X to use the right Win key as "compose key". This has nothing to do with KDE configuration, it should work in every desktop. The compose character for the inverse wedge you mentioned (caron) is "c", so pressing "Right Win" + "C", releasing the keys, and then pressing "A" yields "ǎ".

Other possibilities: é, è, â, ā, å, ç, ®, ©, ™, Æ
Back to top
View user's profile Send private message
Skyer
n00b
n00b


Joined: 21 Mar 2011
Posts: 57
Location: Europe

PostPosted: Wed Mar 23, 2011 7:02 pm    Post subject: Reply with quote

Thanks for your reply,
however, your's posted configuration does not work for me, it brakes keyboard input somehow, so no input is registered at all. (No keys at all, had to click back to console login).

I think I am missing something here, this was the first time I installed X and Kde by hand, so it's possible that I am missing something basic.
Back to top
View user's profile Send private message
Apheus
Guru
Guru


Joined: 12 Jul 2008
Posts: 422

PostPosted: Wed Mar 23, 2011 7:36 pm    Post subject: Reply with quote

For this configuration to work, you need x11-base/xorg-server version >= 1.9, and evdev support in your kernel.

Complete X server configuration guide: http://www.gentoo.org/doc/en/xorg-config.xml
Back to top
View user's profile Send private message
Skyer
n00b
n00b


Joined: 21 Mar 2011
Posts: 57
Location: Europe

PostPosted: Wed Mar 23, 2011 8:31 pm    Post subject: Reply with quote

Well,
I have got xorg-server installed (1.9.4), Event Interface (assuming that that's evdev) is enabled in kernel too. I'll dig more into configuration guide for now, maybe I configured something wrong...
Back to top
View user's profile Send private message
jbouzan
Tux's lil' helper
Tux's lil' helper


Joined: 23 Nov 2007
Posts: 138

PostPosted: Wed Mar 23, 2011 8:49 pm    Post subject: Reply with quote

Can you maybe configure some kind of global shortcuts in kcharselect? First emerge kcharselect
Back to top
View user's profile Send private message
Skyer
n00b
n00b


Joined: 21 Mar 2011
Posts: 57
Location: Europe

PostPosted: Thu Mar 24, 2011 2:15 pm    Post subject: Reply with quote

jbouzan wrote:
Can you maybe configure some kind of global shortcuts in kcharselect? First emerge kcharselect

Yeah, that could be back door solution, but I would like to have it all work "naturally", making shortcuts for all keys would be kind of pain. Thanks for suggestion though.
Back to top
View user's profile Send private message
Skyer
n00b
n00b


Joined: 21 Mar 2011
Posts: 57
Location: Europe

PostPosted: Thu Mar 24, 2011 6:16 pm    Post subject: Reply with quote

Finally managed to solve it,
but only for Gnome - I simply applied local keyboard layout. I have done same thing with KDE, but I am not sure if it works/is saved actually, because I can't edit system setting there - "not authenticated" - also running as root produces failure.

EDIT: Well, now it seems like some applications support "mine way to type international characters", and some not. (Firefox supports it well, but not Psi+, for example).
Back to top
View user's profile Send private message
Etal
Veteran
Veteran


Joined: 15 Jul 2005
Posts: 1931

PostPosted: Thu Mar 24, 2011 8:20 pm    Post subject: Reply with quote

If you're still interested in the Compose key, try out this tutorial. It worked well for me (except you you have to be sure xmodmap is run each time you login)
_________________
“And even in authoritarian countries, information networks are helping people discover new facts and making governments more accountable.”– Hillary Clinton, Jan. 21, 2010
Back to top
View user's profile Send private message
Apheus
Guru
Guru


Joined: 12 Jul 2008
Posts: 422

PostPosted: Thu Mar 24, 2011 10:50 pm    Post subject: Reply with quote

SkyerSK wrote:
Well, now it seems like some applications support "mine way to type international characters", and some not.


GTK+ (which firefox is based on) supports it, Qt (which Psi+ is based on) not. There was some discussion if this is to be implemented at Toolkit/Desktop/X11 level:

http://bugs.kde.org/show_bug.cgi?id=103788
http://en.wikipedia.org/wiki/Unicode_input#Hex_input
Back to top
View user's profile Send private message
Etal
Veteran
Veteran


Joined: 15 Jul 2005
Posts: 1931

PostPosted: Fri Mar 25, 2011 12:57 am    Post subject: Reply with quote

Compose key, on the other hand, is an Xorg feature (tooklit-independent), so it will work with anything ;)
_________________
“And even in authoritarian countries, information networks are helping people discover new facts and making governments more accountable.”– Hillary Clinton, Jan. 21, 2010
Back to top
View user's profile Send private message
Skyer
n00b
n00b


Joined: 21 Mar 2011
Posts: 57
Location: Europe

PostPosted: Fri Mar 25, 2011 3:13 pm    Post subject: Reply with quote

Etal wrote:
If you're still interested in the Compose key, try out this tutorial. It worked well for me (except you you have to be sure xmodmap is run each time you login)


Thanks, I have compose key active, but I still can't type those characters. Compose key + ´ + s produces standard s, so there will be probably some patches with additional shortcuts needed, if this is the way it was done (in other distributions). I'll do some research there, so maybe I can find out how they do it.

Apheus wrote:
GTK+ (which firefox is based on) supports it, Qt (which Psi+ is based on) not. There was some discussion if this is to be implemented at Toolkit/Desktop/X11 level:
http://bugs.kde.org/show_bug.cgi?id=103788
http://en.wikipedia.org/wiki/Unicode_input#Hex_input

Thanks for explanation.
Back to top
View user's profile Send private message
Etal
Veteran
Veteran


Joined: 15 Jul 2005
Posts: 1931

PostPosted: Fri Mar 25, 2011 3:24 pm    Post subject: Reply with quote

Hmm, maybe it's because of the different keyboardl layout? Because ' + s = ś for me :(

What does your apostrophe return if you press it with xev? I get:
Quote:
KeyPress event, serial 34, synthetic NO, window 0x2c00001,
root 0xb1, subw 0x0, time 53922955, (-182,-38), root:(369,270),
state 0x10, keycode 48 (keysym 0x27, apostrophe), same_screen YES,


You can make your own rules by writing into .XCompose:
Code:
<Multi_key> <your-apostrophe> <s> : "ś"


Changes happen to newly-opened applications.
_________________
“And even in authoritarian countries, information networks are helping people discover new facts and making governments more accountable.”– Hillary Clinton, Jan. 21, 2010
Back to top
View user's profile Send private message
Skyer
n00b
n00b


Joined: 21 Mar 2011
Posts: 57
Location: Europe

PostPosted: Fri Mar 25, 2011 4:00 pm    Post subject: Reply with quote

Oh I am sorry,
Compose + ' + s = ś for me too, but the ' symbol is not made by a key I am used to when making ś (which actually does not exists in my language). I standardly use ´ key, with corresponding letter. So
´ + s = ś
ˇ + s = š

I'll take a look at .XCompose file, but I am afraid that I am missing some more general feature here.
Back to top
View user's profile Send private message
Etal
Veteran
Veteran


Joined: 15 Jul 2005
Posts: 1931

PostPosted: Fri Mar 25, 2011 4:42 pm    Post subject: Reply with quote

I guess I am misunderstanding your problem. I thought you wanted to be able to type characters that are not on your keyboard.

If you have those keys on your keyboard then I think they should work if you have the right keyboard layout... Which one do you use? Maybe what you're looking for is AltGr?

Unfortunately, I don't know much about non-English keyboards :(
_________________
“And even in authoritarian countries, information networks are helping people discover new facts and making governments more accountable.”– Hillary Clinton, Jan. 21, 2010
Back to top
View user's profile Send private message
Skyer
n00b
n00b


Joined: 21 Mar 2011
Posts: 57
Location: Europe

PostPosted: Fri Mar 25, 2011 4:59 pm    Post subject: Reply with quote

I am trying to type, for example, letter ś.

I am used to do it pressing Shift + ´ + s. Also, I can type single ´ by pressing ´ + ´ (huh, those two keys pressed continuously produce that symbol).
The ´ key is located left to backspace, it's row is right under row with F keys (F1,F2..).

Also it's analogous for ˇ. I use same key, but I have to hold shift while pressing it. (Shift + ´ + s = š).

´ key is not compose key, I can't write letters like ô, @ with it.

Compose + ' + s = ś, but for me ' key is not ´ key. I mean, those two haven't anything to do with each other. The ' key is located next to the enter key.

Hope I made myself clear, I am not national English speaker, so sorry for my English.
Back to top
View user's profile Send private message
Apheus
Guru
Guru


Joined: 12 Jul 2008
Posts: 422

PostPosted: Fri Mar 25, 2011 5:20 pm    Post subject: Reply with quote

Maybe you need an "nodeadkeys" variant of your keyboard layout. A "dead key" is a key which produces nothing when pressed alone, but yields a character when a key is pressed afterwards. Your ´ is a dead key: You can press ´ and nothing happens, but when you press "E" afterwards, you get "é" (If I understood you correctly). To type ´ alone, you have to press it twice.

The line
Code:
"XkbVariant" "nodeadkeys"


in my configuration makes ´ a real key: I press it once, and I get the character. But I have no possibility to type "é" like in Windows (the "dead key" method is Window's standard method to input characters with accents if the accent is on the keyboard).

I am not sure how the "dead key" setting interacts with compose keys. However, for me the "nodeadkeys" variant is a sub-variant of the keyboard layout "de" for german language. I don't know if there is a "nodeadkeys" variant for your keyboard layout, you will have to try or search www.

About the two keys ´ (acute) and ' (apostrophe): I can type ś with both keys, but with apostrophe it's more complicated because I have to use shift (apostrophe is secondary on the "#" key left to "Return" on german keyboards). I do not use any custom .Xmodmap file, so this is standard behaviour of x11-base/xorg-server-1.9.4 with my XkbModel/Layout/Variant.
Back to top
View user's profile Send private message
Skyer
n00b
n00b


Joined: 21 Mar 2011
Posts: 57
Location: Europe

PostPosted: Fri Mar 25, 2011 5:27 pm    Post subject: Reply with quote

Thanks for your reply.
From the description you provided, I am used to type with deadkeys on. I would like to have Shift + ´ + s = š style of typing globally in X, but as you mentioned before, it only works in GTK+ applications.
That's why I would like to make it global somehow, so it won't depend on any toolkits. I, however, don't know how...
Back to top
View user's profile Send private message
cjubon
Guru
Guru


Joined: 03 Jul 2007
Posts: 450
Location: Vienna/Europe

PostPosted: Fri Mar 25, 2011 10:04 pm    Post subject: Reply with quote

Kde allows you to have multiple keyboard layouts (systemsettings > region/country > keyboard layout > check the „activate keyboard layouts“ checkbox and move the layouts you need in to the right column, let’s say us-english, german, and slovak). You can switch between these layouts by clicking on the flag that appears in your taskbar.

Further, you should double check that you defined your country’s keyboard layout in /etc/conf.d/keymaps.

Hope this helps.
_________________
Mandrake Dec 2001 · Debian "Woody" Aug 2002 · Gentoo Jan 2004 · Funtoo Oct 2009
Back to top
View user's profile Send private message
Anthony J. Bentley
n00b
n00b


Joined: 26 Mar 2011
Posts: 2

PostPosted: Sat Mar 26, 2011 5:09 am    Post subject: Reply with quote

Apheus wrote:
I am not sure how the "dead key" setting interacts with compose keys.

Dead keys are a form of compose key. In fact, ~/.XCompose lets you define sequences for any key, including, say, 1 1 3 to produce a string “foo.”

I have AltGr set up to produce dead keys on my keyboard (AltGr + ' becomes dead acute, for example). Then my ~/.XCompose can convert that to a sequence:
Code:
<dead_acute> <A> : "Á"
<dead_acute> <E> : "É"
<dead_acute> <I> : "Í"
<dead_acute> <O> : "Ó"
<dead_acute> <U> : "Ú"
<dead_acute> <Y> : "Ý"
<dead_acute> <a> : "á"
<dead_acute> <e> : "é"
<dead_acute> <i> : "í"
<dead_acute> <o> : "ó"
<dead_acute> <u> : "ú"
<dead_acute> <y> : "ý"


Apheus wrote:
An example configuration file for X (/etc/X11/xorg.conf.d/11-keyboard.conf):

Code:
Section "InputClass"
        Identifier "keyboard-all"
        Driver "evdev"
        Option "XkbLayout" "de"
        Option "XkbVariant" "nodeadkeys"
        Option "XkbOptions" "compose:rwin"
        MatchIsKeyboard "on"
EndSection

This can be equivalently done with “setxkbmap -layout de -variant nodeadkeys -option compose:rwin”. Since he wants dead keys, though, I think he wants “setxkbmap -layout de -option compose:rwin”. cjubon, ry running that in your terminal.

Since dead keys are really just compose keys, you should remove ~/.XCompose if you have one so that it doesn’t interfere. Having that file removes the default dead key sequences provided by the German layout, and you don’t want that.

SkyerSK wrote:
Thanks for your reply.
From the description you provided, I am used to type with deadkeys on. I would like to have Shift + ´ + s = š style of typing globally in X, but as you mentioned before, it only works in GTK+ applications.

GTK and QT apps are unfriendly and define their own sequences. Set the environment variables “GTK_IM_MODULE=xim” and “QT_IM_MODULE=xim”; then all X apps should behave the same way. If X’s dead keys are set up correctly, everything should work at this point.
Back to top
View user's profile Send private message
Skyer
n00b
n00b


Joined: 21 Mar 2011
Posts: 57
Location: Europe

PostPosted: Sat Mar 26, 2011 6:05 pm    Post subject: Reply with quote

Thanks for your replies,
cjubon wrote:

I have proper keyboard layout selected in both Gnome, and Kde too. (I actually use Gnome more, but I wanted to see how does Kde 4.6.1 look like). I also should have right keymap specified in /etc/conf.d/keymaps, but I think that one affects only shell.

By the way, is it just coincidence that you used slovak in example? I am actually from Slovakia....

Anthony J. Bentley wrote:

I'll try that, though it would be really nice to have it done without any modifications in home directories. I haven't seen this in other distributions, so just I'm wondering how they did it. Isn't there any way to load Gnome's layout into X? I am still newbie when it comes to X and Linux at all, so it's possible that the question makes no sense. I basically guess that shell has it's own keymap, Xorg too, and also Gnome. Gnome runs on "top" , so it can override the others and run properly. Qt is somehow on the same level as Gnome , and it ignores it's sequences, and that's why I have to set up them in "lower level". Am I right?
Back to top
View user's profile Send private message
cjubon
Guru
Guru


Joined: 03 Jul 2007
Posts: 450
Location: Vienna/Europe

PostPosted: Sun Mar 27, 2011 8:19 pm    Post subject: Reply with quote

Skyer wrote:
By the way, is it just coincidence that you used slovak in example? I am actually from Slovakia....

:wink:
_________________
Mandrake Dec 2001 · Debian "Woody" Aug 2002 · Gentoo Jan 2004 · Funtoo Oct 2009
Back to top
View user's profile Send private message
Skyer
n00b
n00b


Joined: 21 Mar 2011
Posts: 57
Location: Europe

PostPosted: Sat Apr 02, 2011 11:22 am    Post subject: Reply with quote

Well,
I haven't made it to satisfying solution so far, but at least, I use GTK+ applications more, so I can use computer without any wider problems. (If anyone found full-time solution, feel free to provide it)
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Desktop Environments All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum