qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Ricardo <ricardo.ribalda@gmail.com>
To: Thiemo Seufer <ths@networkno.de>
Cc: qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] [Patch] AltGr on vnc and adding extra keys with no compiling
Date: Tue, 28 Aug 2007 00:28:13 -0400	[thread overview]
Message-ID: <aa76a2be0708272128g5de7bc5dl9b13d02557f68a2a@mail.gmail.com> (raw)
In-Reply-To: <aa76a2be0708271219i4bdb19f2s49f8e0d1bc7f9c02@mail.gmail.com>

[-- Attachment #1: Type: text/plain, Size: 2144 bytes --]

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

On 8/27/07, Ricardo <ricardo.ribalda@gmail.com> wrote:
> 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
> On 8/26/07, Thiemo Seufer <ths@networkno.de> wrote:
> > Ricardo wrote:
> > > 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.
> >
> > Thanks. Please update it for current CVS and resend.
> >
> >
> > Thiemo
> >
>
>
> --
> Ricardo Ribalda
> http://www.ii.uam.es/~rribalda/
>
>


-- 
Ricardo Ribalda
http://www.ii.uam.es/~rribalda/

[-- Attachment #2: altgr-capslock-numkeysym-extendedkb.dff --]
[-- Type: application/octet-stream, Size: 3659 bytes --]

? backup-082720072326-pre-qemu.tgz
? description-pak
? doc-pak
? qemu_20070827-1_i386.deb
Index: keymaps.c
===================================================================
RCS file: /sources/qemu/qemu/keymaps.c,v
retrieving revision 1.2
diff -u -r1.2 keymaps.c
--- keymaps.c	30 Apr 2006 21:28:35 -0000	1.2
+++ keymaps.c	28 Aug 2007 04:08:17 -0000
@@ -24,7 +24,14 @@
 
 static int get_keysym(const char *name)
 {
+    unsigned int keysym;
     name2keysym_t *p;
+   
+    //User numerical added keysyms
+    if (1==sscanf(name,"0x%x",&keysym))
+            return keysym;
+    
+    //Normal ones
     for(p = name2keysym; p->name != NULL; p++) {
         if (!strcmp(p->name, name))
             return p->keysym;
Index: sdl.c
===================================================================
RCS file: /sources/qemu/qemu/sdl.c,v
retrieving revision 1.42
diff -u -r1.42 sdl.c
--- sdl.c	21 Jun 2007 21:08:02 -0000	1.42
+++ sdl.c	28 Aug 2007 04:09:19 -0000
@@ -201,9 +201,9 @@
         break;
     case 0x45: /* num lock */
     case 0x3a: /* caps lock */
-        /* SDL does not send the key up event, so we generate it */
-        kbd_put_keycode(keycode);
-        kbd_put_keycode(keycode | 0x80);
+    	if (ev->type == SDL_KEYUP)
+		kbd_put_keycode(keycode | 0x80);
+	else kbd_put_keycode(keycode);	
         return;
     }
 
Index: vnc_keysym.h
===================================================================
RCS file: /sources/qemu/qemu/vnc_keysym.h,v
retrieving revision 1.2
diff -u -r1.2 vnc_keysym.h
--- vnc_keysym.h	7 Jan 2007 17:12:41 -0000	1.2
+++ vnc_keysym.h	28 Aug 2007 04:10:12 -0000
@@ -215,6 +215,7 @@
 {"Shift_R", 0xffe2},   /* XK_Shift_R */
 {"Super_L", 0xffeb},   /* XK_Super_L */
 {"Super_R", 0xffec},   /* XK_Super_R */
+{"ISO_Level3_Shift", 0xfe03}, /* ISO_Level3
 
     /* special keys */
 {"BackSpace", 0xff08}, /* XK_BackSpace */
Index: hw/ps2.c
===================================================================
RCS file: /sources/qemu/qemu/hw/ps2.c,v
retrieving revision 1.6
diff -u -r1.6 ps2.c
--- hw/ps2.c	20 Mar 2007 16:45:27 -0000	1.6
+++ hw/ps2.c	28 Aug 2007 04:12:48 -0000
@@ -146,17 +146,24 @@
     PS2State *s = (PS2State *)opaque;
     PS2Queue *q;
     int val, index;
+    static int flag=0;
     
     q = &s->queue;
     if (q->count == 0) {
+	if (!flag){
+	   index=q->rptr - 1;
+	   flag=1;
+	}
+	else index=q->rptr - 2;
         /* NOTE: if no data left, we return the last keyboard one
            (needed for EMM386) */
         /* XXX: need a timer to do things correctly */
-        index = q->rptr - 1;
         if (index < 0)
-            index = PS2_QUEUE_SIZE - 1;
+            index += PS2_QUEUE_SIZE;
+
         val = q->data[index];
     } else {
+	flag=0;
         val = q->data[q->rptr];
         if (++q->rptr == PS2_QUEUE_SIZE)
             q->rptr = 0;
Index: keymaps/es
===================================================================
RCS file: /sources/qemu/qemu/keymaps/es,v
retrieving revision 1.1
diff -u -r1.1 es
--- keymaps/es	12 Dec 2004 16:56:30 -0000	1.1
+++ keymaps/es	28 Aug 2007 04:13:57 -0000
@@ -71,6 +71,8 @@
 Lstroke 0x26 shift altgr
 ntilde 0x27
 Ntilde 0x27 shift
+0xfff1 0x27
+0xffd1 0x27 shift
 dead_doubleacute 0x27 shift altgr
 dead_acute 0x28
 dead_diaeresis 0x28 shift
Index: keymaps/modifiers
===================================================================
RCS file: /sources/qemu/qemu/keymaps/modifiers,v
retrieving revision 1.2
diff -u -r1.2 modifiers
--- keymaps/modifiers	1 Mar 2005 21:43:42 -0000	1.2
+++ keymaps/modifiers	28 Aug 2007 04:13:59 -0000
@@ -3,6 +3,7 @@
 
 Alt_R 0xb8
 Mode_switch 0xb8
+ISO_Level3_Shift 0xb8
 Alt_L 0x38
 
 Control_R 0x9d

      reply	other threads:[~2007-08-28  4:28 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-08-23 22:09 [Qemu-devel] [Patch] AltGr on vnc and adding extra keys with no compiling Ricardo
2007-08-26 17:43 ` Thiemo Seufer
2007-08-27 19:19   ` Ricardo
2007-08-28  4:28     ` Ricardo [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=aa76a2be0708272128g5de7bc5dl9b13d02557f68a2a@mail.gmail.com \
    --to=ricardo.ribalda@gmail.com \
    --cc=qemu-devel@nongnu.org \
    --cc=ths@networkno.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).