Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[KBM] Multi Keyboard Support #1460

Closed
evilC opened this issue Mar 5, 2020 · 25 comments
Closed

[KBM] Multi Keyboard Support #1460

evilC opened this issue Mar 5, 2020 · 25 comments
Labels
Product-Keyboard Shortcut Manager Issues regarding Keyboard Shortcut Manager

Comments

@evilC
Copy link

evilC commented Mar 5, 2020

https://github.com/microsoft/PowerToys/wiki/Keyboard-Manager#18--solutions-or-expectations

To me, this implies the ability to have keyboard-specific hotkeys - for example if I have a separate USB numpad and wish to remap the keys on it whilst suppressing the native functionality of the key, but not to affect the native functionality of the same key on my main keyboard.
eg Remap Numpad1 on the second numpad keyboard to MediaPlayPause, but not affect the functionality of Numpad1 on my main keyboard.
None of the software that I am aware of supports this. HID can differentiate devices but cannot suppress input. Hooks can suppress input but cannot differentiate devices.
The only solution that I am aware of to do this is the Interception keyboard filter driver - I have written an AHK wrapper for this, but it is not natively supported by AHK
Can you please clarify whether this is what is meant by the term, and if you plan to support some way of doing this in PowerToys?

@mattague
Copy link

mattague commented Mar 5, 2020

If you read farther down, they describe it pretty well. Section 2.1 Priority 7 States "Multiple keyboard support. Example: Surface Laptop and Surface keyboard have different layout and a remap maybe needed."

Section 4.3/4.4 show the ability to select individual keyboards and how the user would edit individual shortcuts on each keyboard

@crutkas
Copy link
Member

crutkas commented Mar 12, 2020

yup, goal is to allow different keyboards and have them remapped accordingly. We're unsure this is possible but that is the goal. We're going to close this out as it is being tracked in via the spec

@crutkas crutkas closed this as completed Mar 12, 2020
@crutkas crutkas added the Product-Keyboard Shortcut Manager Issues regarding Keyboard Shortcut Manager label Mar 12, 2020
@saahmedm
Copy link
Contributor

just as an update, this is currently not available to do with public APIs, and we're working to change that. as a result of prioritization of key features and the work this would take, we're pushing this back and it will not be part of our V1. still working on it though!

@saahmedm saahmedm added this to the Suggested Enhancements milestone Aug 6, 2020
@saahmedm saahmedm added the Idea-Enhancement New feature or request on an existing product label Aug 6, 2020
@saahmedm saahmedm reopened this Aug 6, 2020
@saahmedm saahmedm closed this as completed Aug 6, 2020
@saahmedm saahmedm removed this from the Suggested Enhancements milestone Aug 6, 2020
@saahmedm saahmedm added Resolution-Won't fix and removed Idea-Enhancement New feature or request on an existing product labels Aug 6, 2020
@crutkas crutkas changed the title What is "Multi Keyboard Support" in the Keyboard Manager wiki page? "Multi-Keyboard Support" in the Keyboard Manager Sep 3, 2020
@TheBestPessimist
Copy link

TheBestPessimist commented Sep 21, 2020

I am also interested in this functionality.

I have found these links, which say that using RawInput, we are able to differentiate the keyboards:

Would this help with implementing multiple keyboards support?

@evilC
Copy link
Author

evilC commented Sep 21, 2020

RI can differentiate between keyboards, but has no blocking, so cannot suppress the native functionality of the key from the second keyboard
There's an interesting article here about combining hooks and rawinput though to achieve that goal

@enricogior
Copy link
Contributor

@crutkas
we should add this information in the wiki, since users keep asking for this feature.

@garretwilson
Copy link

This would be really useful. Has this ticket really been closed?

I note that the Karabiner Elements for Mac allows different key mapping for different keyboards.

This is really needed in my case:

  • When my laptop is docked, I don't need any remappings for my external keyboard.
  • When using one laptop, the "home and end" keys are on some of the F keys, so there is no way to turn on <F1>, <F2>, etc. and have <Home>/<End> work unless I remap the two double-duty keys.
  • On an external keyboard I use for traveling, some of the keys have horrible placements (e.g. <Pause> where <Delete> should be), so I need to remap them.

Obviously I don't want to have these remappings on all the time. Even if PowerToys at least allowed me to manually choose a list of settings from a drop-down would be better than nothing, although keyboard detection would be ideal.

This is pretty much the main reason I'm using PowerToys. Is there another utility that already has keyboard detection?

@crutkas
Copy link
Member

crutkas commented Jul 17, 2022

Issue is to best of our knowledge, there isn’t currently a solid API to detect which keyboard which input came from with how we do input. If we flip to scan code or another method, we will revisit this but as of now, our system isn’t compatible

this was one of our goals when we started out.

@cjbarth
Copy link

cjbarth commented Jul 17, 2022

there isn’t currently a solid API to detect which keyboard which input came from with how we do input

This is a problem I've experienced with other keyboard-related projects I've worked on. Is there a way to get the Windows team involved here so they can either provide guidance or update the APIs in Windows to allow for this very useful feature? The usefulness extends well beyond convenience and really allows some powerful interactions in multi-keyboard scenarios (video editing, CAD, broadcasting, gaming, programming, etc.).

@wingdagger
Copy link

I also would really like to have this feature. I use an external Bluetooth keyboard and I need to remap the Alt and Windows keys to make them consistent with the laptop's built-in keyboard. Thank you!

@teceoh
Copy link

teceoh commented Sep 10, 2022

It would be perfect if it was in PowerToys. I currently use Macros MultiKeyboard, but I don't like the interface and especially the price.lol

@garretwilson
Copy link

garretwilson commented Sep 10, 2022

An update on my situation: I've switched to AutoHotkey and turned off PowerToys.

Even if PowerToys can't detect the keyboard, it could at least allow me to configure different named groups of hotkeys (e.g. one for each keyboard), and provide a hotkey to switch among them (analogous to switching languages on Windows). But in PowerToys it's all-or-nothing. I can't even manually go in and choose a group of hotkey definitions. And if I remember correctly, it doesn't support hotkeys using Win. So as far as the keyboard mapping is concerned, there isn't much "power" in PowerToys.

This is what I was wanting PowerToys for, so since it doesn't support this use case, I've abandoned it.

@mngyng
Copy link

mngyng commented Nov 15, 2022

An update on my situation: I've switched to AutoHotkey and turned off PowerToys.

Same here. Placed a AHK script in my Windows startup folder, by default turned off.
Edit my script to do the mapping, and used F1 key to toggle on/off the mapping. Here's my script:

Suspend, on
RCtrl::Del
End::PgDn
Home::PgUp
PgDn::End
PgUp::Home
NumLock::F12
F1::Suspend,Toggle

Used this mapping on a laptop for easier access of the Del/Home/End/F12 buttons, and keep it flexible if I want to plug in a keyboard/mouse/monitor combo for a comfy production setting.

Found somewhere saying plugin events of USB keyboards could be used in an AHK script, but so far I'm happy using F1.

The problem with PowerToys is that it takes too many clicks to get to the keyboad mapping part, and to make it worse there's no way to create and pin a shortcut of PowerToys to the taskbar.

@TheBestPessimist
Copy link

TheBestPessimist commented Nov 15, 2022

Found somewhere saying plugin events of USB keyboards could be used in an AHK script, but so far I'm happy using F1.

hey @mngyng, I have a script doing exactly that. Please see the function changeKeyOrderByDetectingUSBKeyboard from https://github.com/thebestpessimist/autohotkey-scripts/blob/8271e3330ab0b81146355ab1ec027164dd882b8a/XmgFusion15.ahk

Basically, i want to do the following:

#If !usbKeyboardAttached (if my external keyboard is *not* attached, change some keys)
{
     PgUp::PgDn
     PgDn::Home
     Home::PgUp
}
#if

@TheBestPessimist

This comment was marked as off-topic.

@mngyng
Copy link

mngyng commented Nov 16, 2022

Found somewhere saying plugin events of USB keyboards could be used in an AHK script, but so far I'm happy using F1.

hey @mngyng, I have a script doing exactly that. Please see the function changeKeyOrderByDetectingUSBKeyboard from https://github.com/thebestpessimist/autohotkey-scripts/blob/8271e3330ab0b81146355ab1ec027164dd882b8a/XmgFusion15.ahk

Copied <saveClipboard()> and <restoreClipboard()> from one of your other .ahk files, replaced the hardware ID in the code with my keyboard ID and finally made it work.

Thank you so much! I've wanted to make this work for like the entire last year.

@ghost
Copy link

ghost commented May 13, 2023

If it is not available in the current api, can’t we even have multiple configs and manually turn it on and off?

I would accept the cost of changing them manually. But currently, we don’t even have the ability to have multiple configs, so we need to change whole configs one by one

@valinet
Copy link

valinet commented Jun 9, 2024

Almost 5 years have passed and Windows still doesn't include an API for this uber requested feature. Good thing they are pushing Recall though, it was much needed./s

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Product-Keyboard Shortcut Manager Issues regarding Keyboard Shortcut Manager
Projects
None yet
Development

No branches or pull requests