cht電腦資訊gcin
adm Find login register

gcin change keyboard layout

guest
1subject: gcin change keyboard layoutPromote 0 Bookmark 02012-09-27quote  

Hi there,

I am using gcin on Archlinux already quite some time and its perfoms much better than any other application I had so far but I still have one problem. I am using a european layout keyboard (german) with 注音 stickers glued on it. When I am swapping input method I can type in chinese but a few keys are changed because the keyboard layout is different in german and taiwanese Layout. My workaround was defining another keybinding to swap my keyboard from german layout to taiwanese (with setxkbmap) but then I still have to change to chinese input which is tiring and also only works half of the time.

 

Is there any way that gcin can change they keyboard layout and the input method at the same time?

 

Best regards,

Georg

eliu

joined: 2007-08-09
posted: 11480
promoted: 617
bookmarked: 187
新竹, 台灣
2subject: Promote 0 Bookmark 02012-09-27quote  

http://www.cl.cam.ac.uk/~mgk25/ucs/keysymdef.h

gcin only accepts English keyboard. I need a table to map X11 latin keys to english keys;

Would you please build this table for me ? I need your help.

For example

#define XK_Oacute                        0x00d3  /* U+00D3 LATIN CAPITAL LETTER O WITH ACUTE */
#define XK_Ocircumflex                   0x00d4  /* U+00D4 LATIN CAPITAL LETTER O WITH CIRCUMFLEX */
#define XK_Otilde                        0x00d5  /* U+00D5 LATIN CAPITAL LETTER O WITH TILDE */
#define XK_Odiaeresis                    0x00d6  /* U+00D6 LATIN CAPITAL LETTER O WITH DIAERESIS */
#define XK_Oslash                        0x00d8  /* U+00D8 LATIN CAPITAL LETTER O WITH STROKE */
#define XK_Ooblique                      0x00d8  /* U+00D8 LATIN CAPITAL LETTER O WITH STROKE */
#define XK_Ugrave                        0x00d9  /* U+00D9 LATIN CAPITAL LETTER U WITH GRAVE */
#define XK_Uacute                        0x00da  /* U+00DA LATIN CAPITAL LETTER U WITH ACUTE */
#define XK_Ucircumflex                   0x00db  /* U+00DB LATIN CAPITAL LETTER U WITH CIRCUMFLEX */
#define XK_Udiaeresis                    0x00dc  /* U+00DC LATIN CAPITAL LETTER U WITH DIAERESIS */
 
the table should be
 
{'O',XK_Oacute,XK_Ocircumflex,XK_Otilde,XK_Odiaeresis, XK_Oslash},
{'U',XK_Ugrave, XK_Ucircumflex, XK_Udiaeresis},
 
I am not familiar with other keys. 
guest
3subject: Promote 0 Bookmark 02012-09-27quote  

Hm I am not sure whether or not I understand what you mean - as far as I have understood you want to map the keys for like "Ä" to "A" and "Ö" to "O" which would be incorrect - in my keyboard layout these special characters are like that (left side german layout, right side Taiwan layout):

" ä " is " ' "

" ö " is " ; "

" ü " is " [ "

" z " is " y "

" y " is " z "

" - " is " / "

" ß " is " - "

" # " is  " \ "

" + " is " ] "

" ´ " is " = "

" ^ " is " ` "

and so on.. thats only those which are different without using Uppercase (Shift) or Alt. If it is difficult to implement to change the global keyboard-map an alternative would be that the user might run a script when the input setting is set to a certain input (so that for example I could have a script with setxkbmap which uses taiwanese Layout once I switch to ZhuIn and german once I switch back).

 

Thanks for your fast answer,

Georg

eliu

joined: 2007-08-09
posted: 11480
promoted: 617
bookmarked: 187
新竹, 台灣
4subject: Promote 0 Bookmark 02012-09-28quote  

guest

" ä " is " ' "

" ö " is " ; "

" ü " is " [ "

" z " is " y "

" y " is " z "

" - " is " / "

" ß " is " - "

" # " is  " \ "

" + " is " ] "

" ´ " is " = "

" ^ " is " ` "

Yes, this is what I want. There is no uppercase definition in your example.

But there is a problem, this must be done as an option, otherwise it will affect other users. I don't like it.

How about adding german .cin (.gtab) input method definition and using an english keyboard ? In this way, I don't have to modify source code.  greek.cin russian.cin are examples, available in the current gcin. You can easily select engilsh, germany, chinese and may other gcin's input methods.

guest
5subject: Promote 0 Bookmark 02012-09-28quote  

Doing keyboard-mapping is not really a good idea thats true, its too specific and there are a lot of layouts around the world.

You are a genius, I would have never thought about doing it the other way round with german being an input method and the keyboard being regarded as english. I will try it that way, thank you very much!

Best regards and thanks for the work you are putting into gcin,

Georg

Guest
joined: 2010-06-05
posted: 57
promoted: 2
bookmarked:
6subject: Promote 0 Bookmark 02012-09-28quote  

Hello,

I also type German sometimes. In this case, probably I can share my experience with you regarding what I do on my Arch box.

I changed my keyboard layout to International keyboard layout (altgr-intl variant). In this case, the right Alt Gr is the dead key and the mappings in general are:

ß - Alt Gr + s
ö - Alt Gr + p
ä - Alt Gr + q
ü - Alt Gr + y
« - Alt Gr + [
» - Alt Gr + ]
€ - Alt Gr + 5

Well, not so many keys to remember and it is easier to code with the English layout, IMHO. The only problem is that it is not so easy to get the keyboard with American layout in Germany. So, I use the British one instead.

Grüße

guest
7subject: Promote 0 Bookmark 02012-09-29quote  

Thank you for your suggestion! That is a quick solution!

I'm rather busy these days so I dont know when I will have time to do so but once I have I would like to write a german.cin (.gtab) in order to be able to switch gcin from chinese to german with only pressing Ctrl+Space. My german keyboard would then simply be treated as english keyboard in the system though gcin would map it to german one - I dont know if its gonna be easy but I think that might be an option as discussed before.

eliu

joined: 2007-08-09
posted: 11480
promoted: 617
bookmarked: 187
新竹, 台灣
8subject: Promote 0 Bookmark 02012-10-03quote  

See the german.cin in the attactment.

gcin2tab german.cin

cp german.gtab ~/.gcin

modify ~/.gcin/gtab.list,

add

german ? german.gtab latin-letters.png

Press 'Shift' key and release to toggle between German & English.

edited: 2

cht電腦資訊gcin
adm Find login register
views:22365