From: Anthony Liguori <anthony@codemonkey.ws>
To: Fabrice Bellard <fabrice@bellard.org>
Cc: qemu-devel@nongnu.org
Subject: [Qemu-devel] Re: [PATCH] Work around VNC clients that do not transmit shifts for uppercase characters
Date: Mon, 01 May 2006 09:52:39 -0500 [thread overview]
Message-ID: <445620B7.4010407@codemonkey.ws> (raw)
In-Reply-To: <4455E739.90300@bellard.org>
[-- Attachment #1: Type: text/plain, Size: 2054 bytes --]
Fabrice Bellard wrote:
> Does it mean that the caps lock keysym is not transmitted by RealVNC ?
> Otherwise converting the upper case to case lower case would suffice.
You're right. New patch attached.
Regards,
Anthony Liguori
> Fabrice.
>
> Anthony Liguori wrote:
>> The spec isn't really clear about what a client should do. This
>> patch is needed for RealVNC clients (at least).
>>
>> Regards,
>>
>> Anthony Liguori
>>
>>
>> ------------------------------------------------------------------------
>>
>> # HG changeset patch
>> # User Anthony Liguori <anthony@codemonkey.ws>
>> # Node ID 8a71740fc36fcaf97e126e581847983cb2a4324d
>> # Parent a9314fc39a5e3d78d80d385f560c922c3ce0e82b
>> Fix for VNC clients that do not send Shift's for uppercase characters
>>
>> diff -r a9314fc39a5e -r 8a71740fc36f vnc.c
>> --- a/vnc.c Sun Apr 30 19:04:17 2006 -0500
>> +++ b/vnc.c Sun Apr 30 23:12:48 2006 -0500
>> @@ -591,11 +591,11 @@ static void pointer_event(VncState *vs, }
>> }
>>
>> -static void key_event(VncState *vs, int down, uint32_t sym)
>> +static void key_event_post(kbd_layout_t *kbd_layout, int down,
>> uint32_t sym)
>> {
>> int keycode;
>>
>> - keycode = keysym2scancode(vs->kbd_layout, sym & 0xFFFF);
>> + keycode = keysym2scancode(kbd_layout, sym & 0xFFFF);
>>
>> if (keycode & 0x80)
>> kbd_put_keycode(0xe0);
>> @@ -603,6 +603,22 @@ static void key_event(VncState *vs, int
>> kbd_put_keycode(keycode & 0x7f);
>> else
>> kbd_put_keycode(keycode | 0x80);
>> +}
>> +
>> +static void key_event(VncState *vs, int down, uint32_t sym)
>> +{
>> +
>> + if (sym >= 'A' && sym <= 'Z') {
>> + sym = (sym - 'A') + 'a';
>> + if (down) {
>> + key_event_post(vs->kbd_layout, 1, 0xffe1);
>> + key_event_post(vs->kbd_layout, 1, sym);
>> + key_event_post(vs->kbd_layout, 0, 0xffe1);
>> + return;
>> + }
>> + }
>> +
>> + key_event_post(vs->kbd_layout, down, sym);
>> }
>>
>> static void framebuffer_update_request(VncState *vs, int incremental,
>
[-- Attachment #2: qemu-vnc-upper2.diff --]
[-- Type: text/plain, Size: 927 bytes --]
# HG changeset patch
# User Anthony Liguori <anthony@codemonkey.ws>
# Node ID a2d60c56904d3e2c08d628461c04b149c74b62cb
# Parent c0fedc4f4e9c870fa2ececc1144596c73e9e475e
Fix uppercase characters
diff -r c0fedc4f4e9c -r a2d60c56904d vnc.c
--- a/vnc.c Mon May 01 18:58:07 2006 +0000
+++ b/vnc.c Mon May 01 09:51:32 2006 -0500
@@ -591,7 +591,7 @@ static void pointer_event(VncState *vs,
}
}
-static void key_event(VncState *vs, int down, uint32_t sym)
+static void do_key_event(VncState *vs, int down, uint32_t sym)
{
int keycode;
@@ -603,6 +603,13 @@ static void key_event(VncState *vs, int
kbd_put_keycode(keycode & 0x7f);
else
kbd_put_keycode(keycode | 0x80);
+}
+
+static void key_event(VncState *vs, int down, uint32_t sym)
+{
+ if (sym >= 'A' && sym <= 'Z')
+ sym = sym - 'A' + 'a';
+ do_key_event(vs, down, sym);
}
static void framebuffer_update_request(VncState *vs, int incremental,
prev parent reply other threads:[~2006-05-01 14:52 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-05-01 4:15 [Qemu-devel] [PATCH] Work around VNC clients that do not transmit shifts for uppercase characters Anthony Liguori
2006-05-01 10:47 ` [Qemu-devel] " Fabrice Bellard
2006-05-01 14:52 ` Anthony Liguori [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=445620B7.4010407@codemonkey.ws \
--to=anthony@codemonkey.ws \
--cc=fabrice@bellard.org \
--cc=qemu-devel@nongnu.org \
/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).