Hi,
I submitted a pull-request over at
and @AndreRH was so kind as to inform me that it wouldn't be picked up over there. ;-)
So, here goes: I'm using wine on macOS with a regular PC keyboard. When using Windows applications, I miss support for the right popup menu key -- that's not the right Windows / Command key, but actually VK_APPS.
I've been patching winemac.drv.so via hex editor manually for quite a while to enable support for this key. Now I thought that I might contribute this otherwise harmless improvement back to the source code.
... I have to admit that I didn't compile the patch myself. :-( But I am convinced that my modification to the source should result in the desired functionality.
Here's the (minuscule) patch to keyboard.c -- if the format shouldn't suffice, you can find everything else in above mentioned wine-mirror link at
---------->8 snip
$ diff keyboard_orig.c keyboard_patched.c 161a162
kVK_APPS = 0x6E,
297c298 < { 0, 0, FALSE }, /* 0x6E unused */ ---
{ VK_APPS, 0x6E, TRUE }, /*
kVK_APPS */ 395a397
{ VK_APPS, "Apps" },
$
Hi,
Thanks for the patch!
You might want to submit it as per the guidelines mentioned here https://wiki.winehq.org/Submitting_Patches.
Cheers, Aaryaman
On Mon, Mar 26, 2018 at 8:07 PM, Gero Zahn geroz@gmx.de wrote:
Hi,
I submitted a pull-request over at
and @AndreRH was so kind as to inform me that it wouldn't be picked up over there. ;-)
So, here goes: I'm using wine on macOS with a regular PC keyboard. When using Windows applications, I miss support for the right popup menu key -- that's not the right Windows / Command key, but actually VK_APPS.
I've been patching winemac.drv.so via hex editor manually for quite a while to enable support for this key. Now I thought that I might contribute this otherwise harmless improvement back to the source code.
... I have to admit that I didn't compile the patch myself. :-( But I am convinced that my modification to the source should result in the desired functionality.
Here's the (minuscule) patch to keyboard.c -- if the format shouldn't suffice, you can find everything else in above mentioned wine-mirror link at
---------->8 snip
$ diff keyboard_orig.c keyboard_patched.c 161a162
kVK_APPS = 0x6E,
297c298 < { 0, 0, FALSE }, /* 0x6E unused */
{ VK_APPS, 0x6E, TRUE }, /* kVK_APPS
*/ 395a397
{ VK_APPS, "Apps" },
$
Hi,
thanks for the additional information. ... I get that, I totally do. But I'm not fully sure if I can comply in all the detail.
Let's try it like this -- will this already suffice?
Thanks,
Gero
------------>8 snip
$ git diff diff --git a/dlls/winemac.drv/keyboard.c b/dlls/winemac.drv/keyboard.c index 3e0ebbf6ec..b0e2d8ea85 100644 --- a/dlls/winemac.drv/keyboard.c +++ b/dlls/winemac.drv/keyboard.c @@ -159,6 +159,7 @@ enum { kVK_F16 = 0x6A, kVK_F14 = 0x6B, kVK_F10 = 0x6D, + kVK_APPS = 0x6E, kVK_F12 = 0x6F, kVK_F15 = 0x71, kVK_Help = 0x72, @@ -294,7 +295,7 @@ static const struct { { VK_F14, 0x65, TRUE }, /* kVK_F14 */ { 0, 0, FALSE }, /* 0x6C unused */ { VK_F10, 0x44, TRUE }, /* kVK_F10 */ - { 0, 0, FALSE }, /* 0x6E unused */ + { VK_APPS, 0x6E, TRUE }, /* kVK_APPS */ { VK_F12, 0x58, TRUE }, /* kVK_F12 */ { 0, 0, FALSE }, /* 0x70 unused */ { VK_F15, 0x66, TRUE }, /* kVK_F15 */ @@ -393,6 +394,7 @@ static const struct { { VK_VOLUME_DOWN | 0x100, "Volume Down" }, { VK_VOLUME_MUTE | 0x100, "Mute" }, { VK_VOLUME_UP | 0x100, "Volume Up" }, + { VK_APPS, "Apps" }, };
HKL CDECL macdrv_GetKeyboardLayout(DWORD); $
Am 26.03.18 um 13:18 schrieb Aaryaman Vasishta:
Hi,
Thanks for the patch!
You might want to submit it as per the guidelines mentioned here https://wiki.winehq.org/Submitting_Patches.
Cheers, Aaryaman
On Mon, Mar 26, 2018 at 8:07 PM, Gero Zahn <geroz@gmx.de mailto:geroz@gmx.de> wrote:
Hi, I submitted a pull-request over at https://github.com/wine-mirror/wine/pull/9 <https://github.com/wine-mirror/wine/pull/9> and @AndreRH was so kind as to inform me that it wouldn't be picked up over there. ;-) So, here goes: I'm using wine on macOS with a regular PC keyboard. When using Windows applications, I miss support for the right popup menu key -- that's not the right Windows / Command key, but actually VK_APPS. I've been patching winemac.drv.so <http://winemac.drv.so> via hex editor manually for quite a while to enable support for this key. Now I thought that I might contribute this otherwise harmless improvement back to the source code. ... I have to admit that I didn't compile the patch myself. :-( But I am convinced that my modification to the source should result in the desired functionality. Here's the (minuscule) patch to keyboard.c -- if the format shouldn't suffice, you can find everything else in above mentioned wine-mirror link at https://github.com/wine-mirror/wine/pull/9/files <https://github.com/wine-mirror/wine/pull/9/files> ---------->8 snip $ diff keyboard_orig.c keyboard_patched.c 161a162 > kVK_APPS = 0x6E, 297c298 < { 0, 0, FALSE }, /* 0x6E unused */ --- > { VK_APPS, 0x6E, TRUE }, /* kVK_APPS */ 395a397 > { VK_APPS, "Apps" }, $
Am 26.03.2018 um 13:41 schrieb Gero Zahn geroz@gmx.de:
Hi,
thanks for the additional information. ... I get that, I totally do. But I'm not fully sure if I can comply in all the detail.
Let's try it like this -- will this already suffice?
The recommended way is to use git send-email. https://wiki.winehq.org/Git_Wine_Tutorial#Sending_the_patches_using_SMTP https://wiki.winehq.org/Git_Wine_Tutorial#Sending_the_patches_using_SMTP has a quick introduction, but I recommend to try to send the patch to yourself first before changing the destination address to wine-devel@winehq.org mailto:wine-devel@winehq.org.
The wiki page also provides other ways to generate the patch emails.
Sorry -- trying to improve wine with a three line patch is not my day job: The more I read, the more complicated it gets.
Giving up. -Gero
Am 26.03.18 um 13:50 schrieb Stefan Dösinger:
Am 26.03.2018 um 13:41 schrieb Gero Zahn <geroz@gmx.de mailto:geroz@gmx.de>:
Hi,
thanks for the additional information. ... I get that, I totally do. But I'm not fully sure if I can comply in all the detail.
Let's try it like this -- will this already suffice?
The recommended way is to use git send-email. https://wiki.winehq.org/Git_Wine_Tutorial#Sending_the_patches_using_SMTP%C2%... a quick introduction, but I recommend to try to send the patch to yourself first before changing the destination address to wine-devel@winehq.org mailto:wine-devel@winehq.org.
The wiki page also provides other ways to generate the patch emails.
Sorry -- trying to submit 3 lines of code to improve wine is not my day job. The more I read, the more complicated it gets.
... Giving up. -Gero
Am 26.03.18 um 13:50 schrieb Stefan Dösinger:
Am 26.03.2018 um 13:41 schrieb Gero Zahn <geroz@gmx.de mailto:geroz@gmx.de>:
Hi,
thanks for the additional information. ... I get that, I totally do. But I'm not fully sure if I can comply in all the detail.
Let's try it like this -- will this already suffice?
The recommended way is to use git send-email. https://wiki.winehq.org/Git_Wine_Tutorial#Sending_the_patches_using_SMTP%C2%... a quick introduction, but I recommend to try to send the patch to yourself first before changing the destination address to wine-devel@winehq.org mailto:wine-devel@winehq.org.
The wiki page also provides other ways to generate the patch emails.
On Mon, Mar 26, 2018 at 7:28 AM, Gero Zahn geroz@gmx.de wrote:
Sorry -- trying to submit 3 lines of code to improve wine is not my day job. The more I read, the more complicated it gets.
... Giving up. -Gero
Hi Gero,
Where did you get that value from? I don't see it in https://github.com/phracker/MacOSX-SDKs/ and can't find it anywhere in google.
Hi Austin,
Am 27.03.18 um 07:24 schrieb Austin English:
Hi Gero,
Where did you get that value from? I don't see it in https://github.com/phracker/MacOSX-SDKs/ and can't find it anywhere in google.
Probably because a genuine Mac keyboard does not have that key. ;-) But it still has a key code when connecting a PC keyboard to a Mac. I got the 0x6e out of Many Tricks Key Codes:
When I press and release the VK_APPS key on my Cherry keyboard connected to my MacBook Pro, this is what happens:
Key Down Characters: Unicode: 16 / 0x10 Keys: Key Code: 110 / 0x6e Modifiers: 256 / 0x100 ⓘ
Key Up Characters: Unicode: 16 / 0x10 Keys: Key Code: 110 / 0x6e Modifiers: 256 / 0x100 ⓘ
As I mentioned earlier: I've been hand-patching winemac.drv.so manually for quite a while now after each new release. For wine-3.0 (through HomeBrew), it's as follows:
$ xxd winemac.drv-fresh.so > winemac.drv-fresh.so.hex $ xxd winemac.drv-patched.so > winemac.drv-patched.so.hex $ diff winemac.drv-fresh.so.hex winemac.drv-patched.so.hex 25998c25998
< 000658d0: 7900 4400 0100 0000 0000 0000 0000 0000 y.D.............
000658d0: 7900 4400 0100 0000 5d00 6e00 0100 0000 y.D.....].n.....
$
As you can see, there's again the 0x6e / 0x100 in it, together with the "target key" 0x5d, as defined in
./include/winuser.rh
like this:
#define VK_APPS 0x5D
If I remember correctly, I got all those crazy winemac.drv.so patching ideas from this blog post:
https://palant.de/2014/02/14/crazy-hacks-changing-wine-key-mappings-on-mac-o...
It became necessary after I had switch from X11 wine to Mac-native wine, and thus patching ~/.Xmodmap didn't have any effect anymore.
Thanks for listening,
Gero
You've also used 0x6e as the Win32 scan code. That seems kind of coincidental. Where'd it come from?
-Ken
On Mar 27, 2018, at 3:47 AM, Gero Zahn geroz@gmx.de wrote:
Hi Austin,
Am 27.03.18 um 07:24 schrieb Austin English:
Hi Gero, Where did you get that value from? I don't see it in https://github.com/phracker/MacOSX-SDKs/ and can't find it anywhere in google.
Probably because a genuine Mac keyboard does not have that key. ;-) But it still has a key code when connecting a PC keyboard to a Mac. I got the 0x6e out of Many Tricks Key Codes:
When I press and release the VK_APPS key on my Cherry keyboard connected to my MacBook Pro, this is what happens:
Key Down Characters: Unicode: 16 / 0x10 Keys: Key Code: 110 / 0x6e Modifiers: 256 / 0x100 ⓘ Key Up Characters: Unicode: 16 / 0x10 Keys: Key Code: 110 / 0x6e Modifiers: 256 / 0x100 ⓘ
As I mentioned earlier: I've been hand-patching winemac.drv.so manually for quite a while now after each new release. For wine-3.0 (through HomeBrew), it's as follows:
$ xxd winemac.drv-fresh.so > winemac.drv-fresh.so.hex $ xxd winemac.drv-patched.so > winemac.drv-patched.so.hex $ diff winemac.drv-fresh.so.hex winemac.drv-patched.so.hex 25998c25998
< 000658d0: 7900 4400 0100 0000 0000 0000 0000 0000 y.D.............
000658d0: 7900 4400 0100 0000 5d00 6e00 0100 0000 y.D.....].n.....
$
As you can see, there's again the 0x6e / 0x100 in it, together with the "target key" 0x5d, as defined in
./include/winuser.rh
like this:
#define VK_APPS 0x5D
If I remember correctly, I got all those crazy winemac.drv.so patching ideas from this blog post:
https://palant.de/2014/02/14/crazy-hacks-changing-wine-key-mappings-on-mac-o...
It became necessary after I had switch from X11 wine to Mac-native wine, and thus patching ~/.Xmodmap didn't have any effect anymore.
Thanks for listening,
Gero
Ummm ... You got me: I merely tried to mimic the existing code, I didn't compile or test it myself. I tried to achieve the
5d00 6e00 0100 0000
hex sequence, which I thought would result from that. Will it or won't it?
Gero
Am 27.03.18 um 22:52 schrieb Ken Thomases:
You've also used 0x6e as the Win32 scan code. That seems kind of coincidental. Where'd it come from?
-Ken
On Mar 27, 2018, at 3:47 AM, Gero Zahn geroz@gmx.de wrote:
Hi Austin,
Am 27.03.18 um 07:24 schrieb Austin English:
Hi Gero, Where did you get that value from? I don't see it in https://github.com/phracker/MacOSX-SDKs/ and can't find it anywhere in google.
Probably because a genuine Mac keyboard does not have that key. ;-) But it still has a key code when connecting a PC keyboard to a Mac. I got the 0x6e out of Many Tricks Key Codes:
When I press and release the VK_APPS key on my Cherry keyboard connected to my MacBook Pro, this is what happens:
Key Down Characters: Unicode: 16 / 0x10 Keys: Key Code: 110 / 0x6e Modifiers: 256 / 0x100 ⓘ Key Up Characters: Unicode: 16 / 0x10 Keys: Key Code: 110 / 0x6e Modifiers: 256 / 0x100 ⓘ
As I mentioned earlier: I've been hand-patching winemac.drv.so manually for quite a while now after each new release. For wine-3.0 (through HomeBrew), it's as follows:
$ xxd winemac.drv-fresh.so > winemac.drv-fresh.so.hex $ xxd winemac.drv-patched.so > winemac.drv-patched.so.hex $ diff winemac.drv-fresh.so.hex winemac.drv-patched.so.hex 25998c25998
< 000658d0: 7900 4400 0100 0000 0000 0000 0000 0000 y.D.............
000658d0: 7900 4400 0100 0000 5d00 6e00 0100 0000 y.D.....].n.....
$
As you can see, there's again the 0x6e / 0x100 in it, together with the "target key" 0x5d, as defined in
./include/winuser.rh
like this:
#define VK_APPS 0x5D
If I remember correctly, I got all those crazy winemac.drv.so patching ideas from this blog post:
https://palant.de/2014/02/14/crazy-hacks-changing-wine-key-mappings-on-mac-o...
It became necessary after I had switch from X11 wine to Mac-native wine, and thus patching ~/.Xmodmap didn't have any effect anymore.
Thanks for listening,
Gero