qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH v4 4/4] hw/input/adb.c: implement QKeyCode suppo


From: Peter Maydell
Subject: Re: [Qemu-devel] [PATCH v4 4/4] hw/input/adb.c: implement QKeyCode support
Date: Sun, 13 Mar 2016 16:00:05 +0000

On 12 March 2016 at 04:27, Programmingkid <address@hidden> wrote:
>
> On Mar 11, 2016, at 10:30 PM, Peter Maydell wrote:
>
>> On 11 March 2016 at 09:32, Programmingkid <address@hidden> wrote:
>>> Remove the old pc_to_adb_keycode array and replace it with QKeyCode support.
>>>
>>> Signed-off-by: John Arbuckle <address@hidden>
>>> ---
>>> Some of the keys do not translate as logically as we would think they 
>>> would. For
>>> example the Q_KEY_CODE_CTRL_R does not work with ADB_KEY_RIGHT_CONTROL. The
>>> wrong key would show up in the guest. These problem keys are commmented out 
>>> and
>>> replaced with the number that does work correctly. This patch can be easily
>>> tested with the Linux command xev or Mac OS's Key Caps.
>>
>> I'm not sure what you mean here. If you press right-control on the host
>> then shouldn't this correspond to right-control on the guest ?
>
> It should. It makes logical sense. But when I tried it using a Mac OS X and
> Linux guest, the wrong key would be pressed. The theories I have are
> incorrect keyboard detection to CUDA translation problems.
>

>>> +    [Q_KEY_CODE_SHIFT]         = ADB_KEY_LEFT_SHIFT,
>>> +    [Q_KEY_CODE_SHIFT_R]       = 123, /* ADB_KEY_RIGHT_SHIFT, */
>>
>> These should definitely be using some ADB_KEY_* constant on
>> the RHS, not a decimal constant.
>
> Ok. It would look something like this:
> [Q_KEY_CODE_SHIFT_R]       = ADB_KEY_LEFT,

I think we definitely need to figure out what is going on here.
Sending the key-left code for right-shift is definitely wrong.
(Presumably this also implies that the actual left-arrow key
is broken...)

Possibly relatedly, the Apple Extended Keyboard apparently won't send
the separate keycodes for right-shift, right-option, right-control
until the guest OS sends the keyboard a command to enable them.
(see
http://www.archive.org/stream/apple-guide-macintosh-family-hardware/Apple_Guide_to_the_Macintosh_Family_Hardware_2e#page/n347/mode/2up
page 309).

I suggest that for this patchset you leave the code so that
it continues to send the same ADB keycodes for these keys
that it has done before (whatever those are). Then once
we've got the conversion to using qcodes in we can look
at fixing this bug as a separate patch.

(Similarly, you might want to split out the code to support
the power key as a separate patch.)

thanks
-- PMM



reply via email to

[Prev in Thread] Current Thread [Next in Thread]