microsoft / PowerToys

Windows system utilities to maximize productivity
MIT License
107.31k stars 6.33k forks source link

Power toys and Apples Boot Camp F15 and F16 remapping with side effects... #17894

Open rin67630 opened 2 years ago

rin67630 commented 2 years ago

Microsoft PowerToys version

V 057.2

Running as admin

Area(s) with issue?

Keyboard Manager

Steps to reproduce

Hi, i am very happy to use Power toys to map an Apple Keyboard to keep some of my habits working on Windows. It works brilliantly (like Karabiner works on macOS) on a PC.

However I had some headaches on a Mac running Windows 10 with Boot Camp. Boot Camp seems to hard-map F14-F16 that way:

F14 -> Print Screen F15 -> Scroll Lock F16 -> Pause

This mapping is not overridden by Power Toys, so the F15 -F16 keys provide the mapped output, plus additionally a parasitic Scroll Lock / Pause respectively.

Since I don't expect any effort from Apple to change that behaviour, could you change your precedence process to catch the keystrokes before the boot-camp driver?

✔️ Expected Behavior

F15, F16 being remapped without side effects

❌ Actual Behavior

Scroll Lock, Pause persists after remapping

Other Software

Apple Boot Camp drivers 6.0.6136

jaimecbernardo commented 2 years ago

Tried to look for some images of an Apple Keyboard, but couldn't find the F14, F15 or F16 keys. Don't really have this setup to give it a try, though ... So when you say that it doesn't work, are you trying to map F14, F15 and F16? What if you map Print Screen Scroll Lock and Pause instead? /needinfo

rin67630 commented 2 years ago

The full size Apple keyboard has F13 to F19. Yes I am trying to map F13 to F19 like I did on macOS with a German keyboard F13 -> Screenshot F14 -> Copy F15 -> Paste F16 -> [ F17 -> ] F18 -> \ F19 -> show Desktop

That works perfectly on a PC and is really useful, since the standard square brackets and backslash heavily used upon programming are only reachable over 3-key combinations on a Mac German keyboard. Once you have used 'single key' copy-paste for a few weeks, you would never want to miss is again, believe me !

The only problem comes when I use the same profiles on a Mac running Boot Camp Windows. Then the your keyboard manager works as well, but the Boot Camp driver keeps assigning its functions. So after a copy with F14, a Print is executed as well and after a paste with F15, a scroll lock too. After a [ with F16 a pause is executed. These additional "keys" interfere with many programs leading to a weird behaviour. I am aware that is a very niche situation and requires a Mac with Boot Camp and a full keyboard to reproduce. I also think that correcting Boot Camp would be the right place to solve it, but Apple won't care helping Windows users, for sure. So if someone feels challenged to grab the key before Boot Camp sees it or maybe empty the keyboard buffer after reassigning keys, that would help me to "evangelize" the Mac users.

On the other side, the Mac keyboard is really friendly to issue special characters, there are many good assignments to take over from their keyboard shortcuts.

Regards

jaimecbernardo commented 2 years ago

Thanks for the added info. Definitely will have to be someone who can replicate this locally. Though I see some challenges here. What we are doing is manipulating the keys in a low-level keyboard hook and sending them on their way, it's then seen/manipulated by the remaining applications. I don't think it's possible to ignore one of those while still having the keystrokes reach their intended application.

rin67630 commented 2 years ago

What we are doing is manipulating the keys in a low-level keyboard hook and sending them on their way, it's then seen/manipulated by the remaining applications.

Apparently the Boot Camp drivers are running at an even lower level, they still see and process the F14 to F16 Keys originally.