All of lore.kernel.org
 help / color / mirror / Atom feed
* [Qemu-devel] Adding more function keys support
@ 2017-12-10  7:10 Programmingkid
  2017-12-12 14:34 ` Daniel P. Berrange
  0 siblings, 1 reply; 10+ messages in thread
From: Programmingkid @ 2017-12-10  7:10 UTC (permalink / raw)
  To: Daniel P. Berrange, QEMU Developers

On Macintosh keyboards there is a key called fn that is used to give the function keys more functionality. Does this key exist in the keyboard keys database? 

Also could keys F16 to F24 (Q_KEY_CODE_F16 to Q_KEY_CODE_F24) be added to the database? 

Thank you. 

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [Qemu-devel] Adding more function keys support
  2017-12-10  7:10 [Qemu-devel] Adding more function keys support Programmingkid
@ 2017-12-12 14:34 ` Daniel P. Berrange
  2017-12-12 17:49   ` Programmingkid
  0 siblings, 1 reply; 10+ messages in thread
From: Daniel P. Berrange @ 2017-12-12 14:34 UTC (permalink / raw)
  To: Programmingkid; +Cc: QEMU Developers

On Sun, Dec 10, 2017 at 02:10:41AM -0500, Programmingkid wrote:
> On Macintosh keyboards there is a key called fn that is used to give the
> function keys more functionality. Does this key exist in the keyboard keys
> database?

When you say "Macintosh keyboards" are you talking about the old style
keyboards with Apple's custom ADB connector, or simply Apple branded
USB keyboards ?

If it is the former (ADB) what key does this correspond to on this
picture:

http://www.archive.org/stream/apple-guide-macintosh-family-hardware/Apple_Guide_to_the_Macintosh_Family_Hardware_2e#page/n345/mode/2up


If its the latter (USB), then please plug it into a Linux machine, and
in a text console (ie not X11) run 'showkey' and press this 'fn' key on
its own and tell me what (if any) hex code gets printed.

Also, under OS-X run this app:

  https://manytricks.com/keycodes/

and again let me know what it reports when the fn key is pressed on its
on.

Then also do the same but press 'fn' in combination with another function
key.

The key thing we need to understand is whether this magic behaviour of
the 'fn' key is actually changing what the main function keys send as
scancodes.

> Also could keys F16 to F24 (Q_KEY_CODE_F16 to Q_KEY_CODE_F24) be added to
> the database?

Those are already defined in keycodemapdb, so we just need to give them
names in the qapi schema, and then add the name mapping to keycodemapdb.

Regards,
Daniel
-- 
|: https://berrange.com      -o-    https://www.flickr.com/photos/dberrange :|
|: https://libvirt.org         -o-            https://fstop138.berrange.com :|
|: https://entangle-photo.org    -o-    https://www.instagram.com/dberrange :|

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [Qemu-devel] Adding more function keys support
  2017-12-12 14:34 ` Daniel P. Berrange
@ 2017-12-12 17:49   ` Programmingkid
  2017-12-13  9:14     ` Daniel P. Berrange
  0 siblings, 1 reply; 10+ messages in thread
From: Programmingkid @ 2017-12-12 17:49 UTC (permalink / raw)
  To: Daniel P. Berrange; +Cc: QEMU Developers


> On Dec 12, 2017, at 9:34 AM, Daniel P. Berrange <berrange@redhat.com> wrote:
> 
> On Sun, Dec 10, 2017 at 02:10:41AM -0500, Programmingkid wrote:
>> On Macintosh keyboards there is a key called fn that is used to give the
>> function keys more functionality. Does this key exist in the keyboard keys
>> database?
> 
> When you say "Macintosh keyboards" are you talking about the old style
> keyboards with Apple's custom ADB connector, or simply Apple branded
> USB keyboards ? 

USB keyboards.

> 
> If its the latter (USB), then please plug it into a Linux machine, and
> in a text console (ie not X11) run 'showkey' and press this 'fn' key on
> its own and tell me what (if any) hex code gets printed.

There was no response to the fn key.

> 
> Also, under OS-X run this app:
> 
>  https://manytricks.com/keycodes/
> 
> and again let me know what it reports when the fn key is pressed on its
> on.

Yes the Key Codes application does report the fn key being pressed. 

Modifier Change
	Keys:		
	Key Code:	65535 / 0xffff
	Modifiers:	8388864 / 0x800100 ⓘ

Modifier Change
	Keys:		
	Key Code:	65535 / 0xffff
	Modifiers:	256 / 0x100 ⓘ

> Then also do the same but press 'fn' in combination with another function
> key.

The value did not change.

> 
> The key thing we need to understand is whether this magic behaviour of
> the 'fn' key is actually changing what the main function keys send as
> scancodes.

This is hard to figure out. If the function key is mapped to a function like Volume Up, then no event is logged in the Key Codes application. So this probably means the operating system catches the key and does not share it with other applications.

> 
>> Also could keys F16 to F24 (Q_KEY_CODE_F16 to Q_KEY_CODE_F24) be added to
>> the database?
> 
> Those are already defined in keycodemapdb, so we just need to give them
> names in the qapi schema, and then add the name mapping to keycodemapdb.

I have a vague memory of doing something like this a long time ago. Hopefully I can find the path if it exists.

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [Qemu-devel] Adding more function keys support
  2017-12-12 17:49   ` Programmingkid
@ 2017-12-13  9:14     ` Daniel P. Berrange
  2017-12-13 16:03       ` Programmingkid
  0 siblings, 1 reply; 10+ messages in thread
From: Daniel P. Berrange @ 2017-12-13  9:14 UTC (permalink / raw)
  To: Programmingkid; +Cc: QEMU Developers

On Tue, Dec 12, 2017 at 12:49:34PM -0500, Programmingkid wrote:
> 
> > On Dec 12, 2017, at 9:34 AM, Daniel P. Berrange <berrange@redhat.com> wrote:
> > 
> > On Sun, Dec 10, 2017 at 02:10:41AM -0500, Programmingkid wrote:
> >> On Macintosh keyboards there is a key called fn that is used to give the
> >> function keys more functionality. Does this key exist in the keyboard keys
> >> database?
> > 
> > When you say "Macintosh keyboards" are you talking about the old style
> > keyboards with Apple's custom ADB connector, or simply Apple branded
> > USB keyboards ? 
> 
> USB keyboards.
> 
> > 
> > If its the latter (USB), then please plug it into a Linux machine, and
> > in a text console (ie not X11) run 'showkey' and press this 'fn' key on
> > its own and tell me what (if any) hex code gets printed.
> 
> There was no response to the fn key.

Doh, I made a mistake - you need to run   'showkey -s'  to get raw scancodes.
Can you try this again, pressing 'fn' on its own, and also press 'fn' in
combination with some function keys.


> >> Also could keys F16 to F24 (Q_KEY_CODE_F16 to Q_KEY_CODE_F24) be added to
> >> the database?
> > 
> > Those are already defined in keycodemapdb, so we just need to give them
> > names in the qapi schema, and then add the name mapping to keycodemapdb.
> 
> I have a vague memory of doing something like this a long time ago.
> Hopefully I can find the path if it exists.

In qapi/ui.json you need to edit the enum 'QKeyCode' to define the
extra keys.

Regards,
Daniel
-- 
|: https://berrange.com      -o-    https://www.flickr.com/photos/dberrange :|
|: https://libvirt.org         -o-            https://fstop138.berrange.com :|
|: https://entangle-photo.org    -o-    https://www.instagram.com/dberrange :|

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [Qemu-devel] Adding more function keys support
  2017-12-13  9:14     ` Daniel P. Berrange
@ 2017-12-13 16:03       ` Programmingkid
  2017-12-13 18:22         ` BALATON Zoltan
  0 siblings, 1 reply; 10+ messages in thread
From: Programmingkid @ 2017-12-13 16:03 UTC (permalink / raw)
  To: Daniel P. Berrange; +Cc: QEMU Developers


> On Dec 13, 2017, at 4:14 AM, Daniel P. Berrange <berrange@redhat.com> wrote:
> 
> On Tue, Dec 12, 2017 at 12:49:34PM -0500, Programmingkid wrote:
>> 
>>> On Dec 12, 2017, at 9:34 AM, Daniel P. Berrange <berrange@redhat.com> wrote:
>>> 
>>> On Sun, Dec 10, 2017 at 02:10:41AM -0500, Programmingkid wrote:
>>>> On Macintosh keyboards there is a key called fn that is used to give the
>>>> function keys more functionality. Does this key exist in the keyboard keys
>>>> database?
>>> 
>>> When you say "Macintosh keyboards" are you talking about the old style
>>> keyboards with Apple's custom ADB connector, or simply Apple branded
>>> USB keyboards ? 
>> 
>> USB keyboards.
>> 
>>> 
>>> If its the latter (USB), then please plug it into a Linux machine, and
>>> in a text console (ie not X11) run 'showkey' and press this 'fn' key on
>>> its own and tell me what (if any) hex code gets printed.
>> 
>> There was no response to the fn key.
> 
> Doh, I made a mistake - you need to run   'showkey -s'  to get raw scancodes.
> Can you try this again, pressing 'fn' on its own, and also press 'fn' in
> combination with some function keys.

Sorry but showkey still did not register the fn key being pushed.

> 
> 
>>>> Also could keys F16 to F24 (Q_KEY_CODE_F16 to Q_KEY_CODE_F24) be added to
>>>> the database?
>>> 
>>> Those are already defined in keycodemapdb, so we just need to give them
>>> names in the qapi schema, and then add the name mapping to keycodemapdb.
>> 
>> I have a vague memory of doing something like this a long time ago.
>> Hopefully I can find the path if it exists.
> 
> In qapi/ui.json you need to edit the enum 'QKeyCode' to define the
> extra keys.

Thank you. I will make a patch that adds these keys.

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [Qemu-devel] Adding more function keys support
  2017-12-13 16:03       ` Programmingkid
@ 2017-12-13 18:22         ` BALATON Zoltan
  2017-12-13 19:18           ` Programmingkid
  0 siblings, 1 reply; 10+ messages in thread
From: BALATON Zoltan @ 2017-12-13 18:22 UTC (permalink / raw)
  To: Programmingkid; +Cc: Daniel P. Berrange, QEMU Developers

On Wed, 13 Dec 2017, Programmingkid wrote:
>> On Dec 13, 2017, at 4:14 AM, Daniel P. Berrange <berrange@redhat.com> wrote:
>>
>> On Tue, Dec 12, 2017 at 12:49:34PM -0500, Programmingkid wrote:
>>>
>>>> On Dec 12, 2017, at 9:34 AM, Daniel P. Berrange <berrange@redhat.com> wrote:
>>>>
>>>> On Sun, Dec 10, 2017 at 02:10:41AM -0500, Programmingkid wrote:
>>>>> On Macintosh keyboards there is a key called fn that is used to give the
>>>>> function keys more functionality. Does this key exist in the keyboard keys
>>>>> database?
>>>>
>>>> When you say "Macintosh keyboards" are you talking about the old style
>>>> keyboards with Apple's custom ADB connector, or simply Apple branded
>>>> USB keyboards ?
>>>
>>> USB keyboards.
>>>
>>>>
>>>> If its the latter (USB), then please plug it into a Linux machine, and
>>>> in a text console (ie not X11) run 'showkey' and press this 'fn' key on
>>>> its own and tell me what (if any) hex code gets printed.
>>>
>>> There was no response to the fn key.
>>
>> Doh, I made a mistake - you need to run   'showkey -s'  to get raw scancodes.
>> Can you try this again, pressing 'fn' on its own, and also press 'fn' in
>> combination with some function keys.
>
> Sorry but showkey still did not register the fn key being pushed.

I don't know how the fn key is handled but the Linux driver knows about it 
so maybe it could help to understand:

https://github.com/torvalds/linux/blob/master/drivers/hid/hid-apple.c

Regards,
BALATON Zoltan

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [Qemu-devel] Adding more function keys support
  2017-12-13 18:22         ` BALATON Zoltan
@ 2017-12-13 19:18           ` Programmingkid
  2017-12-14  2:20             ` Eric Blake
  2017-12-14 10:27             ` Daniel P. Berrange
  0 siblings, 2 replies; 10+ messages in thread
From: Programmingkid @ 2017-12-13 19:18 UTC (permalink / raw)
  To: BALATON Zoltan; +Cc: Daniel P. Berrange, QEMU Developers


> On Dec 13, 2017, at 1:22 PM, BALATON Zoltan <balaton@eik.bme.hu> wrote:
> 
> On Wed, 13 Dec 2017, Programmingkid wrote:
>>> On Dec 13, 2017, at 4:14 AM, Daniel P. Berrange <berrange@redhat.com> wrote:
>>> 
>>> On Tue, Dec 12, 2017 at 12:49:34PM -0500, Programmingkid wrote:
>>>> 
>>>>> On Dec 12, 2017, at 9:34 AM, Daniel P. Berrange <berrange@redhat.com> wrote:
>>>>> 
>>>>> On Sun, Dec 10, 2017 at 02:10:41AM -0500, Programmingkid wrote:
>>>>>> On Macintosh keyboards there is a key called fn that is used to give the
>>>>>> function keys more functionality. Does this key exist in the keyboard keys
>>>>>> database?
>>>>> 
>>>>> When you say "Macintosh keyboards" are you talking about the old style
>>>>> keyboards with Apple's custom ADB connector, or simply Apple branded
>>>>> USB keyboards ?
>>>> 
>>>> USB keyboards.
>>>> 
>>>>> 
>>>>> If its the latter (USB), then please plug it into a Linux machine, and
>>>>> in a text console (ie not X11) run 'showkey' and press this 'fn' key on
>>>>> its own and tell me what (if any) hex code gets printed.
>>>> 
>>>> There was no response to the fn key.
>>> 
>>> Doh, I made a mistake - you need to run   'showkey -s'  to get raw scancodes.
>>> Can you try this again, pressing 'fn' on its own, and also press 'fn' in
>>> combination with some function keys.
>> 
>> Sorry but showkey still did not register the fn key being pushed.
> 
> I don't know how the fn key is handled but the Linux driver knows about it so maybe it could help to understand:
> 
> https://github.com/torvalds/linux/blob/master/drivers/hid/hid-apple.c
> 
> Regards,
> BALATON Zoltan

Thank you BALATON for the file. One thing that caught my eye in this file is this:

static int hidinput_apple_event(struct hid_device *hid, struct input_dev *input,
		struct hid_usage *usage, __s32 value)
{
	struct apple_sc *asc = hid_get_drvdata(hid);
	const struct apple_key_translation *trans, *table;

	if (usage->code == KEY_FN) {
		asc->fn_on = !!value;

Why would they need the double !? 

I think the input_event() function is what sends key input to the applications. It appears that the function key is not sent to input_event().

This key is usable with QEMU on Mac OS X. The NSEventTypeFlagsChanged event is what detects it in the cocoa.m file. Currently the code does not account for this key. I will make a patch to add support for the function key soon.

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [Qemu-devel] Adding more function keys support
  2017-12-13 19:18           ` Programmingkid
@ 2017-12-14  2:20             ` Eric Blake
  2017-12-14  2:23               ` Programmingkid
  2017-12-14 10:27             ` Daniel P. Berrange
  1 sibling, 1 reply; 10+ messages in thread
From: Eric Blake @ 2017-12-14  2:20 UTC (permalink / raw)
  To: Programmingkid, BALATON Zoltan; +Cc: QEMU Developers

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

On 12/13/2017 01:18 PM, Programmingkid wrote:

> Thank you BALATON for the file. One thing that caught my eye in this file is this:
> 

> 	if (usage->code == KEY_FN) {
> 		asc->fn_on = !!value;
> 
> Why would they need the double !? 

Double '!!' is an idiomatic way to force a value to be converted to bool
(squashing all non-zero values into 1).

-- 
Eric Blake, Principal Software Engineer
Red Hat, Inc.           +1-919-301-3266
Virtualization:  qemu.org | libvirt.org


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 619 bytes --]

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [Qemu-devel] Adding more function keys support
  2017-12-14  2:20             ` Eric Blake
@ 2017-12-14  2:23               ` Programmingkid
  0 siblings, 0 replies; 10+ messages in thread
From: Programmingkid @ 2017-12-14  2:23 UTC (permalink / raw)
  To: Eric Blake; +Cc: BALATON Zoltan, QEMU Developers


> On Dec 13, 2017, at 9:20 PM, Eric Blake <eblake@redhat.com> wrote:
> 
> On 12/13/2017 01:18 PM, Programmingkid wrote:
> 
>> Thank you BALATON for the file. One thing that caught my eye in this file is this:
>> 
> 
>> 	if (usage->code == KEY_FN) {
>> 		asc->fn_on = !!value;
>> 
>> Why would they need the double !? 
> 
> Double '!!' is an idiomatic way to force a value to be converted to bool
> (squashing all non-zero values into 1).
> 
> -- 
> Eric Blake, Principal Software Engineer
> Red Hat, Inc.           +1-919-301-3266
> Virtualization:  qemu.org | libvirt.org
> 

Thank you for the information.

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [Qemu-devel] Adding more function keys support
  2017-12-13 19:18           ` Programmingkid
  2017-12-14  2:20             ` Eric Blake
@ 2017-12-14 10:27             ` Daniel P. Berrange
  1 sibling, 0 replies; 10+ messages in thread
From: Daniel P. Berrange @ 2017-12-14 10:27 UTC (permalink / raw)
  To: Programmingkid; +Cc: BALATON Zoltan, QEMU Developers

On Wed, Dec 13, 2017 at 02:18:49PM -0500, Programmingkid wrote:
> 
> > On Dec 13, 2017, at 1:22 PM, BALATON Zoltan <balaton@eik.bme.hu> wrote:
> > 
> > On Wed, 13 Dec 2017, Programmingkid wrote:
> >>> On Dec 13, 2017, at 4:14 AM, Daniel P. Berrange <berrange@redhat.com> wrote:
> >>> 
> >>> On Tue, Dec 12, 2017 at 12:49:34PM -0500, Programmingkid wrote:
> >>>> 
> >>>>> On Dec 12, 2017, at 9:34 AM, Daniel P. Berrange <berrange@redhat.com> wrote:
> >>>>> 
> >>>>> On Sun, Dec 10, 2017 at 02:10:41AM -0500, Programmingkid wrote:
> >>>>>> On Macintosh keyboards there is a key called fn that is used to give the
> >>>>>> function keys more functionality. Does this key exist in the keyboard keys
> >>>>>> database?
> >>>>> 
> >>>>> When you say "Macintosh keyboards" are you talking about the old style
> >>>>> keyboards with Apple's custom ADB connector, or simply Apple branded
> >>>>> USB keyboards ?
> >>>> 
> >>>> USB keyboards.
> >>>> 
> >>>>> 
> >>>>> If its the latter (USB), then please plug it into a Linux machine, and
> >>>>> in a text console (ie not X11) run 'showkey' and press this 'fn' key on
> >>>>> its own and tell me what (if any) hex code gets printed.
> >>>> 
> >>>> There was no response to the fn key.
> >>> 
> >>> Doh, I made a mistake - you need to run   'showkey -s'  to get raw scancodes.
> >>> Can you try this again, pressing 'fn' on its own, and also press 'fn' in
> >>> combination with some function keys.
> >> 
> >> Sorry but showkey still did not register the fn key being pushed.
> > 
> > I don't know how the fn key is handled but the Linux driver knows about it so maybe it could help to understand:
> > 
> > https://github.com/torvalds/linux/blob/master/drivers/hid/hid-apple.c

> I think the input_event() function is what sends key input to the applications. It appears that the function key is not sent to input_event().

Linux works by turning the keyboard specific scancodes into a standardized
set of key codes that are agnostic of any hardware. Thus Linux doesn't
send the 'fn' key itself. It sees the 'fn'+XXX key combination and sends
a single event. You can see the mapping Linux uses:

static const struct apple_key_translation macbookair_fn_keys[] = {
	{ KEY_BACKSPACE, KEY_DELETE },
	{ KEY_ENTER,	KEY_INSERT },
	{ KEY_F1,	KEY_BRIGHTNESSDOWN, APPLE_FLAG_FKEY },
	{ KEY_F2,	KEY_BRIGHTNESSUP,   APPLE_FLAG_FKEY },
	{ KEY_F3,	KEY_SCALE,          APPLE_FLAG_FKEY },
	{ KEY_F4,	KEY_DASHBOARD,      APPLE_FLAG_FKEY },
	{ KEY_F6,	KEY_PREVIOUSSONG,   APPLE_FLAG_FKEY },
	{ KEY_F7,	KEY_PLAYPAUSE,      APPLE_FLAG_FKEY },
	{ KEY_F8,	KEY_NEXTSONG,       APPLE_FLAG_FKEY },
	{ KEY_F9,	KEY_MUTE,           APPLE_FLAG_FKEY },
	{ KEY_F10,	KEY_VOLUMEDOWN,     APPLE_FLAG_FKEY },
	{ KEY_F11,	KEY_VOLUMEUP,       APPLE_FLAG_FKEY },
	{ KEY_F12,	KEY_EJECTCD,        APPLE_FLAG_FKEY },
	{ KEY_UP,	KEY_PAGEUP },
	{ KEY_DOWN,	KEY_PAGEDOWN },
	{ KEY_LEFT,	KEY_HOME },
	{ KEY_RIGHT,	KEY_END },
	{ }
};

static const struct apple_key_translation apple_fn_keys[] = {
	{ KEY_BACKSPACE, KEY_DELETE },
	{ KEY_ENTER,	KEY_INSERT },
	{ KEY_F1,	KEY_BRIGHTNESSDOWN, APPLE_FLAG_FKEY },
	{ KEY_F2,	KEY_BRIGHTNESSUP,   APPLE_FLAG_FKEY },
	{ KEY_F3,	KEY_SCALE,          APPLE_FLAG_FKEY },
	{ KEY_F4,	KEY_DASHBOARD,      APPLE_FLAG_FKEY },
	{ KEY_F5,	KEY_KBDILLUMDOWN,   APPLE_FLAG_FKEY },
	{ KEY_F6,	KEY_KBDILLUMUP,     APPLE_FLAG_FKEY },
	{ KEY_F7,	KEY_PREVIOUSSONG,   APPLE_FLAG_FKEY },
	{ KEY_F8,	KEY_PLAYPAUSE,      APPLE_FLAG_FKEY },
	{ KEY_F9,	KEY_NEXTSONG,       APPLE_FLAG_FKEY },
	{ KEY_F10,	KEY_MUTE,           APPLE_FLAG_FKEY },
	{ KEY_F11,	KEY_VOLUMEDOWN,     APPLE_FLAG_FKEY },
	{ KEY_F12,	KEY_VOLUMEUP,       APPLE_FLAG_FKEY },
	{ KEY_UP,	KEY_PAGEUP },
	{ KEY_DOWN,	KEY_PAGEDOWN },
	{ KEY_LEFT,	KEY_HOME },
	{ KEY_RIGHT,	KEY_END },
	{ }
};

static const struct apple_key_translation powerbook_fn_keys[] = {
	{ KEY_BACKSPACE, KEY_DELETE },
	{ KEY_F1,	KEY_BRIGHTNESSDOWN,     APPLE_FLAG_FKEY },
	{ KEY_F2,	KEY_BRIGHTNESSUP,       APPLE_FLAG_FKEY },
	{ KEY_F3,	KEY_MUTE,               APPLE_FLAG_FKEY },
	{ KEY_F4,	KEY_VOLUMEDOWN,         APPLE_FLAG_FKEY },
	{ KEY_F5,	KEY_VOLUMEUP,           APPLE_FLAG_FKEY },
	{ KEY_F6,	KEY_NUMLOCK,            APPLE_FLAG_FKEY },
	{ KEY_F7,	KEY_SWITCHVIDEOMODE,    APPLE_FLAG_FKEY },
	{ KEY_F8,	KEY_KBDILLUMTOGGLE,     APPLE_FLAG_FKEY },
	{ KEY_F9,	KEY_KBDILLUMDOWN,       APPLE_FLAG_FKEY },
	{ KEY_F10,	KEY_KBDILLUMUP,         APPLE_FLAG_FKEY },
	{ KEY_UP,	KEY_PAGEUP },
	{ KEY_DOWN,	KEY_PAGEDOWN },
	{ KEY_LEFT,	KEY_HOME },
	{ KEY_RIGHT,	KEY_END },
	{ }
};

The first column in these tables is the physical key pressed, and the
second column is what Linux sends with the 'fn' key is combined.

IOW,  'fn'+'f1' results in 'brightnessdown'

QEMU will work in a similar way - we're not going to send around the 'fn'
key internally to QEMU, instead we'll only send the combination keys.
IOW, we'll need to make sure QEMU has keycodes defined for everything in
the second columns of these tables.

> This key is usable with QEMU on Mac OS X. The NSEventTypeFlagsChanged event
> is what detects it in the cocoa.m file. Currently the code does not account
> for this key. I will make a patch to add support for the function key soon.

So if Cocoa can see the 'fn' key, then it'll need todo similar to what
Linux does - comibing the 'fn' key and keystroke that follows, into a
single QEMU keycode.

Regards,
Daniel
-- 
|: https://berrange.com      -o-    https://www.flickr.com/photos/dberrange :|
|: https://libvirt.org         -o-            https://fstop138.berrange.com :|
|: https://entangle-photo.org    -o-    https://www.instagram.com/dberrange :|

^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2017-12-14 10:27 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-12-10  7:10 [Qemu-devel] Adding more function keys support Programmingkid
2017-12-12 14:34 ` Daniel P. Berrange
2017-12-12 17:49   ` Programmingkid
2017-12-13  9:14     ` Daniel P. Berrange
2017-12-13 16:03       ` Programmingkid
2017-12-13 18:22         ` BALATON Zoltan
2017-12-13 19:18           ` Programmingkid
2017-12-14  2:20             ` Eric Blake
2017-12-14  2:23               ` Programmingkid
2017-12-14 10:27             ` Daniel P. Berrange

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.