On Nov 5, 2012, at 2:48 PM, Mark Cave-Ayland wrote:
On 04/11/12 03:21, Programmingkid wrote:
The get-key-map word is used by Bootx to determine which key is being held down at startup time. Since the Command key can't be detected in QEMU, the Control key is used instead. If the user holds down Control-v while Mac OS X starts up in QEMU, get-key-map will report that Command-v is being held down. Allowing the user to have Mac OS X to boot up in Verbose mode.
I agree with Segher in that there are two things here - one is the implementation of get-key-map, and the second is the mapping of the Command key within QEMU.
You are aware that this word is only called once during the boot sequence of Mac OS X? The only thing this patch would affect is BootX. The keyboard will still behave normally. This patch will not make the Control key be detected by the Operating System as the Command key. This patch will only make get-key-map return an array that indicates the Command key is being held down when the Control key is held down.
Have you asked on the qemu mailing list to find out whether this is already handled in a different way for other OSs? And if not, what the suggested fix should be?
I haven't contacted the QEMU mailing list. The get-key-map word appears to be an Apple added word, so other OS's will not use it. You don't like the fact the Control key is mapped as the Command key. QEMU currently does not send the Command key to the emulated system. Even if you sent in a patch to the QEMU people to fix this issue, it is not likely it will be accepted. I do know that right now, this is how QEMU works, and we have to work with it.
There are other issues to deal with if the Command key were sent to the guest OS. If QEMU was placed in full screen mode, how would the user return to windowed mode? Command-F wouldn't work any more. Another issue is what word would we use to detect the Command key? The "key" word is what I use to detect the pushed key on the keyboard. Would this word be able to detect the Command key?