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

Allow to remap complex keyboard events (macros) #5668

Open
antonioyon opened this issue Aug 5, 2020 · 26 comments
Open

Allow to remap complex keyboard events (macros) #5668

antonioyon opened this issue Aug 5, 2020 · 26 comments
Labels
Idea-New PowerToy Suggestion for a PowerToy Product-Keyboard Shortcut Manager Issues regarding Keyboard Shortcut Manager

Comments

@antonioyon
Copy link

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.

@ghost ghost added the Needs-Triage For issues raised to be triaged and prioritized by internal Microsoft teams label Aug 5, 2020
@arjunbalgovind
Copy link
Contributor

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.

@crutkas crutkas added Idea-Enhancement New feature or request on an existing product Product-Keyboard Shortcut Manager Issues regarding Keyboard Shortcut Manager and removed Needs-Triage For issues raised to be triaged and prioritized by internal Microsoft teams labels Aug 17, 2020
@crutkas crutkas added this to the Suggested Enhancements milestone Aug 17, 2020
@crutkas crutkas mentioned this issue Aug 20, 2020
@arjunbalgovind
Copy link
Contributor

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 enricogior added Idea-New PowerToy Suggestion for a PowerToy and removed Idea-Enhancement New feature or request on an existing product Product-Keyboard Shortcut Manager Issues regarding Keyboard Shortcut Manager labels Feb 5, 2021
@enricogior
Copy link
Contributor

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
Copy link

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!

@jczanfona
Copy link

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
Copy link
Contributor

rcmaehl commented Aug 13, 2023

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

  • Missing Characters from Key Remapper due to not being able to map keys the existing keyboard doesn't have including multilingual and media keys

Should be debated

  • Character -> String Mapping (Ex: A -> {shift}this{space}is{space}a{space}sentence{!}{enter})
  • Context Aware Key Remapping (Ex: A -> Q in Excel Only)
  • Sequence of Characters -> Different Sequence of Characters (Ex: IDK -> I don't know)

Would best be a plugin

  • Character -> Mouse/Other Input
  • Character -> Program Execution
  • PowerAutomate Integration
  • Managing Audio Devices (Excluding Volume Up/Volume Down/Mute for Default Audio Device)
  • AutoIt / AHK Integration

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
Copy link
Collaborator

Jay-o-Way commented Feb 1, 2024

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
Copy link
Collaborator

htcfreek commented Feb 1, 2024

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

@rcmaehl nade something like this.

@realbart
Copy link

realbart commented Feb 2, 2024

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
Copy link

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

@Korb
Copy link

Korb commented Oct 5, 2024

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.

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

No branches or pull requests