AltGr on vnc and adding extra keys with no compiling
PATCH 1/1 AltGr on vnc and adding extra keys with no compiling
Hi
On my keyboard Alt Gr is mapped to ISO_Level3_Shift. Using sdl it worked fine without any modification, but using vnc I was unable to use Alt Gr.
I added a line on /usr/share/keymaps/modifiers refering to my key:
ISO_Level3_Shift 0xb8
But, unfortunately it didn't work....
Surfing on the qemu code, I realized that the ISO_Level3_Shitf wasn't declared on the vnc_keysym.h file. So I added this line to that file:
{"ISO_Level3_Shift", 0xfe03}, /* ISO_Level3
And finally Alt Gr worked!
I think that it should be a good idea to allow the user to add keysym manually by number and name. Instead of just name. This will allow to add keysyms with no qemu recompiling. this can be done very easilly. Just modfying get_keysym on keymaps.c
I attach a pacth with this two improves.
Regards and congratulations for a great program!
PS: Please CC me
Signature · 2 lines
Ricardo Ribalda http://www.ii.uam.es/~rribalda/
keymaps/es +55 -0
@@ -103,3 +103,58 @@ underscore 0x35 shift dead_belowdot 0x35 altgr dead_abovedot 0x35 shift altgr + + +# Dead keys +aacute 0x1e dead_acute +Aacute 0x1e dead_acute shift +eacute 0x12 dead_acute +Eacute 0x12 dead_acute shift +iacute 0x17 dead_acute +Iacute 0x17 dead_acute shift +oacute 0x18 dead_acute +Oacute 0x18 dead_acute shift +uacute 0x16 dead_acute +Uacute 0x16 dead_acute shift +yacute 0x15 dead_acute +Yacute 0x15 dead_acute shift + +agrave 0x1e dead_grave +Agrave 0x1e dead_grave shift +egrave 0x12 dead_grave +Egrave 0x12 dead_grave shift +igrave 0x17 dead_grave +Igrave 0x17 dead_grave shift +ograve 0x18 dead_grave +Ograve 0x18 dead_grave shift +ugrave 0x16 dead_grave +Ugrave 0x16 dead_grave shift + +adiaeresis 0x1e dead_diaeresis +Adiaeresis 0x1e dead_diaeresis shift +ediaeresis 0x12 dead_diaeresis +Ediaeresis 0x12 dead_diaeresis shift +idiaeresis 0x17 dead_diaeresis +Idiaeresis 0x17 dead_diaeresis shift +odiaeresis 0x18 dead_diaeresis +Odiaeresis 0x18 dead_diaeresis shift +udiaeresis 0x16 dead_diaeresis +Udiaeresis 0x16 dead_diaeresis shift +ydiaeresis 0x15 dead_diaeresis + +acircumflex 0x1e dead_circumflex +Acircumflex 0x1e dead_circumflex shift +ecircumflex 0x12 dead_circumflex +Ecircumflex 0x12 dead_circumflex shift +icircumflex 0x17 dead_circumflex +Icircumflex 0x17 dead_circumflex shift +ocircumflex 0x18 dead_circumflex +Ocircumflex 0x18 dead_circumflex shift +ucircumflex 0x16 dead_circumflex +Ucircumflex 0x16 dead_circumflex shift + +acute 0x39 dead_acute +grave 0x39 dead_grave +diaeresis 0x39 dead_diaeresis +asciicircum 0x39 dead_circumflex +
keymaps.c +76 -12
151 lines not on this page · raw message
sdl.c +5 -1
@@ -104,7 +104,11 @@ keysym = ev->keysym.sym;if (keysym ==0 && ev->keysym.scancode ==113 ) keysym =SDLK_MODE ; -return keysym2scancode (kbd_layout, keysym); +keydata_t *eventdata =find_keysym (kbd_layout, keysym); +if (eventdata==NULL ) +return 0 ; +else +return eventdata->keycode; }/* specific keyboard conversions from scan codes */
vnc.c +99 -8
128 lines not on this page · raw message
vnc_keysym.h +49 -7
73 lines not on this page · raw message
Quoted 19 lines · Ricardo
Hi
On my keyboard Alt Gr is mapped to
ISO_Level3_Shift. Using sdl it worked fine without any modification, but using vnc I was unable to use Alt Gr.
I added a line on/usr/share/keymaps/modifiersrefering to my key:
ISO_Level3_Shift0xb8But, unfortunately it didn't work....
Surfing on the qemu code, I realized that the
ISO_Level3_Shitfwasn't declared on thevnc_keysym.hfile. So I added this line to that file:{"
ISO_Level3_Shift",0xfe03}, /*ISO_Level3And finally Alt Gr worked!
Quoted 7 lines
I think that it should be a good idea to allow the user to add keysym manually by number and name. Instead of just name. This will allow to add keysyms with no qemu recompiling. this can be done very easilly. Just modfying
get_keysymonkeymaps.cI attach a pacth with this two improves.
Thanks. Please update it for current CVS and resend.
Thiemo
Hi
I attach the new patch. PLEASE REMOVE THE OLD ONE!!!, I sent a
completely wrong file :S (sorry).
I have downloaded de cvs version and patched with this new file, wich solves:
a) ISO_Level_3 is now correctly reconized as alt gr on vnc mode
b) User can add its own keysym by number
c) My sdl library gives two events for cap lock (press and release).
Now it is recognized correctly
d) Some minor changes in order to compile correctly the program
Everything has been tested with DOS 7.2 as target.
Sorry again for the first mistake and congratulations again for a
GREAT program
Regards
ps: please cc me
Quoted 33 lines · Thiemo Seufer
Quoted 19 lines · Ricardo
Hi
On my keyboard Alt Gr is mapped to
ISO_Level3_Shift. Using sdl it worked fine without any modification, but using vnc I was unable to use Alt Gr.
I added a line on/usr/share/keymaps/modifiersrefering to my key:
ISO_Level3_Shift0xb8But, unfortunately it didn't work....
Surfing on the qemu code, I realized that the
ISO_Level3_Shitfwasn't declared on thevnc_keysym.hfile. So I added this line to that file:{"
ISO_Level3_Shift",0xfe03}, /*ISO_Level3And finally Alt Gr worked!
Quoted 7 lines
I think that it should be a good idea to allow the user to add keysym manually by number and name. Instead of just name. This will allow to add keysyms with no qemu recompiling. this can be done very easilly. Just modfying
get_keysymonkeymaps.cI attach a pacth with this two improves.
Thanks. Please update it for current CVS and resend.
Thiemo
Signature · 2 lines
Ricardo Ribalda http://www.ii.uam.es/~rribalda/
Index: keymaps.c
===================================================================
RCS file: /sources/qemu/qemu/keymaps.c,v
retrieving revision 1.2
diff -r1.2 keymaps.c
26a27
Quoted 1 line
unsigned int keysym;
27a29,34
Quoted 6 lines
//User numerical added keysyms
if (1==sscanf(name,"0x%x",&keysym))
return keysym;
//Normal onesIndex: sdl.c
===================================================================
RCS file: /sources/qemu/qemu/sdl.c,v
retrieving revision 1.42
diff -r1.42 sdl.c
204,206c204,206
< /* SDL does not send the key up event, so we generate it */ < kbd_put_keycode(keycode); < kbd_put_keycode(keycode | 0x80);
---
Quoted 3 lines
if (ev->type == SDL_KEYUP) kbd_put_keycode(keycode | 0x80); else kbd_put_keycode(keycode);
Index: vnc_keysym.h
===================================================================
RCS file: /sources/qemu/qemu/vnc_keysym.h,v
retrieving revision 1.2
diff -r1.2 vnc_keysym.h
217a218
Quoted 1 line
{"
ISO_Level3_Shift",0xfe03}, /*ISO_Level3
Index: keymaps/es
===================================================================
RCS file: /sources/qemu/qemu/keymaps/es,v
retrieving revision 1.1
diff -r1.1 es
73a74,75
Quoted 2 lines
0xfff10x270xffd10x27shift
Index: keymaps/modifiers
===================================================================
RCS file: /sources/qemu/qemu/keymaps/modifiers,v
retrieving revision 1.2
diff -r1.2 modifiers
5a6
Quoted 1 line
ISO_Level3_Shift0xb8
Hi all
I find out that in DOS some programs didn't handle correctly the
extended keyboard. Attach you will find a new patch with the bugs solved on the previous patch + this new bug.
Regards
Quoted 64 lines · Ricardo
Hi
I attach the new patch. PLEASE REMOVE THE OLD ONE!!!, I sent a
completely wrong file :S (sorry).I have downloaded de cvs version and patched with this new file, wich solves:
a)
ISO_Level_3is now correctly reconized as alt gr on vnc mode
b) User can add its own keysym by number
c) My sdl library gives two events for cap lock (press and release).
Now it is recognized correctly
d) Some minor changes in order to compile correctly the programEverything has been tested with DOS 7.2 as target.
Sorry again for the first mistake and congratulations again for a
GREAT programRegards
ps: please cc me
Quoted 26 lines · Thiemo Seufer
Quoted 25 lines · Ricardo
Hi
On my keyboard Alt Gr is mapped to
ISO_Level3_Shift. Using sdl it worked fine without any modification, but using vnc I was unable to use Alt Gr.
I added a line on/usr/share/keymaps/modifiersrefering to my key:
ISO_Level3_Shift0xb8But, unfortunately it didn't work....
Surfing on the qemu code, I realized that the
ISO_Level3_Shitfwasn't declared on thevnc_keysym.hfile. So I added this line to that file:{"
ISO_Level3_Shift",0xfe03}, /*ISO_Level3And finally Alt Gr worked!
I think that it should be a good idea to allow the user to add keysym manually by number and name. Instead of just name. This will allow to add keysyms with no qemu recompiling. this can be done very easilly. Just modfying
get_keysymonkeymaps.cQuoted 7 lines
Quoted 1 line
I attach a pacth with this two improves.
Thanks. Please update it for current CVS and resend.
Thiemo
--
Ricardo Ribalda
http://www.ii.uam.es/~rribalda/
Signature · 2 lines
Ricardo Ribalda http://www.ii.uam.es/~rribalda/