qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Programmingkid <programmingkidx@gmail.com>
To: BALATON Zoltan <balaton@eik.bme.hu>
Cc: "Daniel P. Berrange" <berrange@redhat.com>,
	QEMU Developers <qemu-devel@nongnu.org>
Subject: Re: [Qemu-devel] Adding more function keys support
Date: Wed, 13 Dec 2017 14:18:49 -0500	[thread overview]
Message-ID: <99BD2069-929C-402A-B38A-778DAB427449@gmail.com> (raw)
In-Reply-To: <alpine.BSF.2.21.1712131914560.26243@zero.eik.bme.hu>


> 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.

  reply	other threads:[~2017-12-13 19:18 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 [this message]
2017-12-14  2:20             ` Eric Blake
2017-12-14  2:23               ` Programmingkid
2017-12-14 10:27             ` Daniel P. Berrange

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=99BD2069-929C-402A-B38A-778DAB427449@gmail.com \
    --to=programmingkidx@gmail.com \
    --cc=balaton@eik.bme.hu \
    --cc=berrange@redhat.com \
    --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).