microsoft / PowerToys

Windows system utilities to maximize productivity
MIT License
111.53k stars 6.56k forks source link

Allow to remap complex keyboard events (macros) #5668

Open antonioyon opened 4 years ago

antonioyon commented 4 years ago

Keyboard Manager should allow mapping complex keyboard events in Key and Mapped To parameters

Currently, the keyboard manager allows for remapping of simple keyboard events, such as single key-down, to a different keyboard event, which may include multiple modifiers (Ctrl, Shift, Alt). It would be a benefit to allow input parameters to be complex keyboard events including modifiers (Ctrl), multiple key events (holding down Shift (Left) and Shift (Right)), and key-up events (mapping Ctrl (Left) to be Ctrl on key-down and Esc on key-up).

The specific use-case I want to see is to replicate an AutoHotKey script that modifies the Caps Lock to Ctrl when pressed with another key, so Caps Lock - V would sendCtrl - V, but to send Esc on key-up if no other key is pressed. Additionally, the script also maps Shift (Left) and Shift (Right) combo to send Caps Lock.


If you'd like to see this feature implemented, add a 👍 reaction to this post.

arjunbalgovind commented 4 years ago

The use case is related to #5679 @crutkas @saahmedm is this something we plan to support in the future? I think having complex events on the left column would be problematic (something that works better with stuff like AHK scripts). For complex events in the right column I feel it would be like an "Advanced mode" which allows custom macros where you would be able to "Type" and the sequence of key strokes will be detected and used (rather than just the keys as we do now). This would be sort of similar to the macro feature in the Microsoft Mouse & Keyboard Center, but that can only be done for programmable keys on certain keyboards.

Regarding the specific use case mentioned above I elaborated on it in #5679.

arjunbalgovind commented 4 years ago

In terms of implementation, the challenges would be figuring out a UI for this. Microsoft Keyboard & Mouse Center has an interesting UI which seems like the best way that it can be presented to the user without requiring actual "scripts". In terms of implementation, we would need to monitor an input sequence of events, and whenever that exact sequence occurs we would send the output events. MKCMacro

enricogior commented 3 years ago

Removing the KBM label since this goes far beyond the scope of KBM. KBM should remain a simple straightforward tool to do what is supposed to do. There are several enhancement suggested for the KBM that hopefully we will do in the future, but this particular suggestion is not about remapping existing shortcut, but about providing extended macro functionality similarly to AutoHotKey .

0-BlackSpectrum-0 commented 3 years ago

In terms of implementation, the challenges would be figuring out a UI for this. Microsoft Keyboard & Mouse Center has an interesting UI which seems like the best way that it can be presented to the user without requiring actual "scripts". In terms of implementation, we would need to monitor an input sequence of events, and whenever that exact sequence occurs we would send the output events. MKCMacro

It looks nice but also can any key on say, my keyboard(except power button) be remapped/used as macro keys, that would be really awesome as some of the keys on my keyboard have no function at all so it'd be nice to remap them to a shortcut or a macro!

GamerClassN7 commented 2 years ago

Hello any progress requarding this toppic ?

moatmai commented 2 years ago

This feature would make my life considerably easier. Use cases:

I wouldn't mind copying and pasting the specific character from charmap into PowerToys.

VladWinner commented 2 years ago

@moatmai Check it out: https://ilyabirman.net/typography-layout/

YeonV commented 2 years ago

Noob-workaround for the time beeing: 1) place a shortcut for your script (i.e. vbs) on your desktop 2) Set a normal Keyboard-shortcut via context-menu -> properties i.e. [CTRL]+[ALT]+[SHIFT]+[F12] 3) in powertoys keyboard manager, remap that combo to something you want

(this will make it possible to run the script on F16-F19 for example)

Jay-o-Way commented 2 years ago

AutoHotkey could do this without breaking a sweat!

theerfan commented 2 years ago

Is this feature ever going to be implemented or not? I'm just saying because this issue has been open for more than 2 years now and its status is still up in the air. I think many would appreciate it if we had a definite answer to this question. Thanks.

Jay-o-Way commented 2 years ago

@theerfan have you tried MS Mouse & Keyboard app or AutoHotkey yet?

theerfan commented 2 years ago

@theerfan have you tried MS Mouse & Keyboard app or AutoHotkey yet?

I am using AutoHotKey, I was just wondering if it was ever going to be implemented here as well. :D

shushilchaurasiya commented 1 year ago

Switch default audio device on windows with keyboard shortcut.

Jay-o-Way commented 1 year ago

https://www.youtube.com/watch?v=--cHILkVUtw Power Automate in the Microsoft Store So, do we really need to keep this open?

moatmai commented 1 year ago

So, do we really need to keep this open?

A number of contributors have suggested to use a different app to solve the issue. IMO that doesn't really address the issue itself: a request to extend PowerToys functionality.

I, for one, am just looking for a way to map special characters, preferrably using Unicode values which you can paste from the Character Map (charmap), in Keyboard Manager.

WGEM-U commented 1 year ago

I agree fully with this comment of moatmai ...

A number of contributors have suggested to use a different app to solve the issue. IMO that doesn't really address the issue itself: a request to extend PowerToys functionality.

NicTanghe commented 1 year ago

Perhaps something that can call/create power automate functions from within powertoys could be handy.

Im all for reducing blat and multiple programs doing the same thing. But it seems like a bit of a hastle to use 40 diferent Guis. Perhaps some sort of gui added to power toys that calls power automate without having to run expensive gui overhead.

And it also seems pointless to have key binds that can't handle combinations. (Note, i’m no longer on Windows )

khaf commented 1 year ago

To add my voice, another use case is to map combination of keys to events: For example, CTRL+DOWN to volume down, CTRL+UP to volume up (because my keyboard does not have media keys).

shevros commented 1 year ago

I'd like to request this macro functionality as well. Extremely useful.

jczanfona commented 1 year ago

So is it already possible to make an assignment for Ctrl+A and Ctrl+C so that that keypress simultaneously selects everything and copies it?

rcmaehl commented 1 year ago

So, do we really need to keep this open?

A number of contributors have suggested to use a different app to solve the issue. IMO that doesn't really address the issue itself: a request to extend PowerToys functionality.

I, for one, am just looking for a way to map special characters, preferrably using Unicode values which you can paste from the Character Map (charmap), in Keyboard Manager.

This issue has grown to encapsulate multiple different kinds of requests that honestly should be categorized differently:

Should be implemented

Should be debated

Would best be a plugin


I've been tackling the plugin-esque features myself in a side project that registers a URI but I think I'll try creating a plugin tomorrow for some basic stuff by borrowing most of @skttl 's ptguid plugin code.

Linking with PowerAutomate should be easy as it has its own registered URI.

Additionally, I can add in AutoIt (the parent of AHK) and probably AHK functionality.

This shouldn't be anything complex to make into a plugin as I'm just punting the input off to PowerAutomate/AutoIt/AHK.

However, I've never started a C# project from scratch, let alone compiled it (to a dll even!) so this will be a fun learning experience.

Jay-o-Way commented 9 months ago

I just got myself a MS 3050 keyboard and mouse. As @arjunbalgovind showed earlier, the Mouse and Keyboard Center app allows you to set a huge number of functions to a lot of keys. Both on the mouse and the keyboard. Both "basic" and "app-specific settings". It's really awesome!

Perhaps something that can call/create power automate functions from within powertoys could be handy.

🤔💭Thinking of a PT Run plug-in... wdyt @htcfreek ?

htcfreek commented 9 months ago

🤔💭Thinking of a PT Run plug-in... wdyt @htcfreek

@rcmaehl nade something like this.

realbart commented 9 months ago

Window 11 has this functionality basically built in:

  1. Go to C:\Users\«your name»\AppData\Roaming\Microsoft\Internet Explorer\Quick Launch\User Pinned\TaskBar
  2. Right click, New, Shortcut to get the new shortcut dialog
  3. Type wt for Windows Terminal and click Next
  4. If you like, change the name to Terminal and click Finish (Note: the actual shortcut won't be actually shown on your taskbar)
  5. Open the properties for the shortcut you just created (Alt+Enter)
  6. On the tab "shortcut"in "shortcut key" press Ctrl+Alt+T
  7. Click Apply

Test it by pressing Ctrl+Alt+T

panda667 commented 2 months ago

Is it possible to toggle the wifi on/off using Powertoys by creating a shortcut in the "Remap Shortcuts" editor?

Korb commented 1 month ago

In addition, in the settings of the module for recording and reproducing macros, there should be the opportunity to set delays between presses (time in milliseconds). This is useful in the case of web interfaces or interactions with storage facilities with a high delay.

In addition, it would be useful for me to be able to set the number of reproduction of the specified macros.