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] Map to custom keys / diacritic character, not just keycode #6976

Open
framctr opened this issue Oct 2, 2020 · 73 comments
Open

[KBM] Map to custom keys / diacritic character, not just keycode #6976

framctr opened this issue Oct 2, 2020 · 73 comments
Labels
Idea-Enhancement New feature or request on an existing product Product-Keyboard Shortcut Manager Issues regarding Keyboard Shortcut Manager
Milestone

Comments

@framctr
Copy link

framctr commented Oct 2, 2020

I would like to use Keyboard Manager to map some shortcuts to keys that currently are accessible only from the "Windows Character Map" application. Specifically I would like to map AltGr + ' to ` and AltGr + ì to ~.
I know that the Keyboard Manager enables only to map to keyboard keys, but allowing also custom characters would be such a great feature for a programmer.

@ghost ghost added the Needs-Triage For issues raised to be triaged and prioritized by internal Microsoft teams label Oct 2, 2020
@Aaron-Junker Aaron-Junker added Product-Keyboard Shortcut Manager Issues regarding Keyboard Shortcut Manager Idea-Enhancement New feature or request on an existing product and removed Needs-Triage For issues raised to be triaged and prioritized by internal Microsoft teams labels Oct 2, 2020
@enricogior enricogior changed the title [Keyboard Manager] Map to custom keys [KBM] Map to custom keys Jan 9, 2021
@enricogior enricogior added Resolution-Duplicate There's another issue on the tracker that's pretty much the same thing. and removed Resolution-Duplicate There's another issue on the tracker that's pretty much the same thing. labels Jan 9, 2021
@enricogior enricogior changed the title [KBM] Map to custom keys [KBM] Map to custom keys (allow keymapping to "character" not just keycode) Jan 9, 2021
@enricogior enricogior changed the title [KBM] Map to custom keys (allow keymapping to "character" not just keycode) [KBM] Map to custom keys / diacritic character, not just keycode Jan 9, 2021
@frenchiveruti
Copy link

To add on this, there's a FOSS project under the name of "WinCompose" that's available at github.
https://github.com/samhocevar/wincompose

@ghost
Copy link

ghost commented Jan 11, 2021

Second this. I am using Japanese layout on my laptop built-in keyboard (US layout). As the underscore key is mission, I want to map Shift + 0 (which is empty in Japanese layout) to _ (Which normally is Shift + \). However, the attempt to add it to the shortcut is buggy and not function in most time, and as soon as I disconnected my USB Japanese keyboard, Shift + 0 will stop working, which makes the remapping useless.

@framctr
Copy link
Author

framctr commented Jan 12, 2021

To add on this, there's a FOSS project under the name of "WinCompose" that's available at github.
https://github.com/samhocevar/wincompose

Good thing, but I would prefer a solution from Microsoft.
From my point of view, this is a so basic feature that it should be included in Windows yet. Just my opinion, but all collegues I met agree.

PS. For now I used the Microsoft Keyboard Layout Creator. It would be better to have a single layout than two similar one to the other except for 2 keys....

@frenchiveruti
Copy link

To add on this, there's a FOSS project under the name of "WinCompose" that's available at github.
https://github.com/samhocevar/wincompose

Good thing, but I would prefer a solution from Microsoft.
From my point of view, this is a so basic feature that it should be included in Windows yet. Just my opinion, but all collegues I met agree.

PS. For now I used the Microsoft Keyboard Layout Creator. It would be better to have a single layout than two similar one to the other except for 2 keys....

Yes, what I meant with my comment is what they could implement in their software that already exists and it's useful.

@enricogior
Copy link
Contributor

@crutkas
this issue has come up several times and there is a lot of feedback from the community, should we included in the stability release or right after it?

@AssemblerAce
Copy link

Apparently this important modification is not yet confirmed for any of the next 4 releases. Hopefully this will be remedied ASAP.

My own pressing need is to be able to remap to ANY Unicode character.

Can Unicode characters be mapped to unused Virtual Keys (VK nnn)?

@crutkas
Copy link
Member

crutkas commented Jan 19, 2021

Lets target right after stability. I'll update the wiki.

@crutkas crutkas removed the Planning-Consideration Consideration for 2021 stability release label Jan 19, 2021
@crutkas crutkas added this to the Backlog milestone Jan 19, 2021
@crutkas
Copy link
Member

crutkas commented Jan 19, 2021

@enricogior this is for support of chords then as well based on some of the closed issues, correct? ala Ctrl-K, Ctrl-C inside VS to comment something. we closed a few issues it looks like against this for chords

@francescoboc
Copy link

@vincenzoml Thanks, I already solved the issue with AutoHotkey.

@paaguti
Copy link

paaguti commented Jul 16, 2023

I think this is a more general issue. I'm based in Spain and consider myself L1 Spanish/German. With a Spanish keyboard I can get the 'ß' as AltGr+s in Linux and macOS and thus my keyboard allows me to write in all languages I'm fluent in (ES/DE/EN/IT) without extra drivers (in Linux) or with an extra app (Karabiner in macOS). But that's something I can't in Windows. I have to confess that returning to Win after 20+ years in linux/macOS has been an accident I couldn't avoid. Not that I'm surprised. Just disappointed...

@berzi
Copy link

berzi commented Jul 16, 2023

I resorted to making my own system based on Autohotkey and it's been working well for me (though it was somewhat buggy on a slower, older computer I used to use). I speak many languages daily and cannot afford to switch layout for each, so this one supports most languages with a latin script.

@georgegom
Copy link

Fantastic work, @berzi ! Brilliant. However, this does not address my need to incorporate some elements from the Latin Extended-D which are essential for my use case and the reason I want the developers to add it to the code of the Keyboard PowerToy or work on a greater version of the Microsoft Keyboard Layout app and incorporate it as a PowerToy.

@berzi
Copy link

berzi commented Jul 18, 2023

Fantastic work, @berzi ! Brilliant. However, this does not address my need to incorporate some elements from the Latin Extended-D which are essential for my use case and the reason I want the developers to add it to the code of the Keyboard PowerToy or work on a greater version of the Microsoft Keyboard Layout app and incorporate it as a PowerToy.

Thank you @georgegom . I'm curious to know what use-case requires those symbols, since I'm not aware of a language that actually uses any of them.

I could add some of them to my layout, since I was already thinking of expanding it to cover Hungarian accent marks.

@cjbarth
Copy link

cjbarth commented Jul 18, 2023

@berzi, I'm wondering if you've ever considered adding support for the characters the Pinyin uses which don't yet seem to exist. See https://en.wikipedia.org/wiki/Pinyin#Tones

It looks like you might just be missing 3rd tone (ˇ) and the variants with the umlaut over the U, which is a multiple diacritic combination. In other IME I've used, the umlaut U is typed by using the letter "v" since that isn't used in Pinyin, but I know that probably wouldn't work for your case, though I suppose you could use the dead key + V combination to result in the umlaut u + tone combination.

@berzi
Copy link

berzi commented Jul 18, 2023

@berzi, I'm wondering if you've ever considered adding support for the characters the Pinyin uses which don't yet seem to exist. See https://en.wikipedia.org/wiki/Pinyin#Tones

It looks like you might just be missing 3rd tone (ˇ) and the variants with the umlaut over the U, which is a multiple diacritic combination. In other IME I've used, the umlaut U is typed by using the letter "v" since that isn't used in Pinyin, but I know that probably wouldn't work for your case, though I suppose you could use the dead key + V combination to result in the umlaut u + tone combination.

@cjbarth I actually have the ˇ (altgr + shift 6), looks like the picture is outdated. But I don't have double diacritics yet, that's what I'll work on next. Thanks. :)

@hrakotobe
Copy link

This would help in a lot of situation.

My 2 cents:

  • AutoHotKey seems to solve part of the problem, but that means running PowerToys in parrallel of another tool. It would be better to not have a bunch of background helper always running and consolidate keyboard management.
  • Quick Accent tool is nice for occasional input here and there. That can't be a solution to actually type whole documents on an everyday basis.
  • Having multiple keyboards is also a solution, but that means doing full layout switches solely depending on needing accents or not. For people using an IME (CJK languages) that's a huge PITA that makes it just impractical.

The most elegant solution would really be to have PowerTools allow for arbitrary mapping (allowing to paste a character feels like a really good interface, but I'd be totally fine with inputing character codes instead)

@georgegom
Copy link

Fantastic work, @berzi ! Brilliant. However, this does not address my need to incorporate some elements from the Latin Extended-D which are essential for my use case and the reason I want the developers to add it to the code of the Keyboard PowerToy or work on a greater version of the Microsoft Keyboard Layout app and incorporate it as a PowerToy.

Thank you @georgegom . I'm curious to know what use-case requires those symbols since I'm unaware of a language that uses any of them.

I could add some of them to my layout since I was already thinking of expanding it to cover Hungarian accent marks.

The use case is to be able to compose text, say in a Romance language like Spanish, where with a single character (i.e. ao ligature) I can save myself from writing out both forms of a particular noun or adjective. It is more elegant than the horrible solution invented by the publishing/editorial industry.

The feature I am asking to be implemented would allow for other characters in the ASCII Latin-D group to be used for other creative purposes, i.e., the use of characters in medieval forms of Indoeuropean languages to express the original form of the word.

Therefore, I want to have an enhanced and better option than Microsoft Keyboard Layout Creator (which does not work correctly in Windows 10 and is not for the faint of heart) which can be done by a feature that lets me map what character I want when I need it. :)

@paaguti
Copy link

paaguti commented Aug 6, 2023 via email

@georgegom
Copy link

¡Felicidades! Glad you do not have this first-world problem. 😉

However, since I am not using Linux, and these are PowerToys for Windows .... need I say more?

@paaguti
Copy link

paaguti commented Aug 7, 2023 via email

@acw23
Copy link

acw23 commented Aug 25, 2023

This is quite literally the only reason I installed PowerTools. You are going to lose out on a lot of your potential base by holding off this feature for this long, especially since the solution should be theoretically easy.

@Hitmanforrent
Copy link

Any update on this? WinCompose is nice but an official Windows compose key would be a very useful thing. Especially since WinCompose isn't digitally signed.

Even just the standard Xorg sequences would be a huge help.

@Manukineko
Copy link

Same question.
WinCompose is dead and plagued with issues if your keyboard layout is anything else than EU/US.
I use a japanese keyboard with a japanses layout and whatever the sequence the soft interpret it with a US layout so it either gives me a wrong combination or just the bare raw characters I've pressed.
A real compose key would be better than creating what is basically snippet into the Keyboard Manager or using the limited Accent Powertoy.

@nev3rfail
Copy link

Hello @Manukineko and others that will find this thread.
I have just finished the app to bind any hotkey to produce any character. Including the Win key. And the Alt key. Even the left Alt key, not just an AltGr.
It's sort of in beta still but works like a charm mostly. eats 6 megabytes of ram and weights only 400kb. https://github.com/nev3rfail/diakritika, binary release is available.

@tilleul
Copy link

tilleul commented Mar 6, 2024

@nev3rfail. Thanks this works for me: it replaces the ² character/key with backtick efficiently. (backtick is ALT-GR+µ on belgian keyboards). The only thing is that the console window of your app displays "verbosity: ERROR" which led me to believe it was not working until I tested it.

@nev3rfail
Copy link

nev3rfail commented Mar 6, 2024

@nev3rfail. Thanks this works for me: it replaces the ² character/key with backtick efficiently. (backtick is ALT-GR+µ on belgian keyboards). The only thing is that the console window of your app displays "verbosity: ERROR" which led me to believe it was not working until I tested it.

@tilleul, that's great:) verbosity: error just shows the current loglevel.
Please be aware that unless the program is running with admin privileges it wont work with elevated applications.
To start the program with the computer startup:

  1. press Win+R, type shell:startup (Explorer autostart will open)
  2. create a shortcut of a program and copypaste it to explorer's autostart

Unfortunately, there is no easy way to add an application to autostart to start as elevated, i'm working on it.

@georgegom
Copy link

georgegom commented Mar 12, 2024 via email

@Caldoric
Copy link

Caldoric commented May 1, 2024

FWIW, stumbled across this GitHub while looking for other, vaguely related stuff, and I have to wonder... Does this project currently allow for the direct use of non-standard keyboard symbols as actual inputs yet, or not? Asking from the perspective of a gamer who needs extra keybinds, rather than what folks might conventionally consider a true "power user". TL:DR, looking to bind some flight stick controls to keyboard-style inputs, but as a supplement to the extant keyboard on my desk, rather than to replace it. The game in question doesn't have options to take stick inputs, and JoyToKey just binds things to existing keyboard controls (which is useless). Macros and chords are a non-starter, given that shift, control, and alt are already bound to stuff, which would cause funky interactions when trying to use them as such (IE Alt-codes for ASCII characters). I've also already bound F13-F24 to the 12 extra buttons on the side of my mouse and made use of them.

For anyone who cares to ask what game I could be playing that might possibly require such an inordinate number of additional keybinds... It's modded Minecraft (Java edition), and I'm not joking. With how most of the larger/more popular mods are these days, extra bindings beyond the norm are an absolute necessity, given they're all usually coded in isolation and default to having their added controls mapped to things like Z,X,C,F,R, etc, meaning there's usually several dozen conflicts per key whenever you first start up a modpack. Unfortunately, from what I've experienced, MMO mice and gaming keyboards with extra buttons and other such peripherals only seem designed with binding macros in mind (or the aforementioned long-disused F13-F24 keys), instead of registering the extra inputs as their own dedicated buttons.

Sorry if this is off-topic for this project, let alone this thread, it's just that this seems like the closest thing to a solution to my problem that I've been able to find. Failing that, could someone point me in a better direction?

@Caldoric
Copy link

Caldoric commented May 1, 2024

For additional clarification, my mouse is one of those Logitech ones with 12 bindable side buttons, a scrollwheel that center-clicks and rocks side-to-side for forward and backwards webpage navigation, and a third "click" option under the ring finger (like the left and right click are under the index and middle fingers, respectively) that's designed as a mode-shift for the 12 side buttons. Additionally, my keyboard (also Logitech) has the standard US QWERTY+Numpad+F1-12 layout, with 9 additional kinda le buttons wrapped around the left edge and above the function keys, as well as a further three buttons meant as a 3-way mode shift for those previously-mentioned 9. The flight stick (a relatively newer acquisition) comes from VKB, and while it does seem to have its own readings as regular stick controls, (which Minecraft doesn't read,) it also has an option to bind all its inputs to keyboard inputs instead, which would be more useful. Unfortunately, all of the above points towards reusing the keys already on my keyboard, instead of as new unique inputs. Which is where I hoped something like this project might come in.

@nev3rfail
Copy link

nev3rfail commented May 11, 2024

@Caldoric There is no such thing as "Register your own input" because there is nothing to register. Inputs can be either virtualkey which is just a 0-255 code, a scancode which is a WORD-sized payload (but there are list of scancodes supported by windows https://learn.microsoft.com/en-us/windows/win32/inputdev/about-keyboard-input (though I don't know what will happen if you paste something unusual to as a scancode and send it to windows)), and unicode which is a crutch over a scancode that allows to send a completely custom payload and is splitted/reassembled if it is too big.
the thing with your request is that sending an input is not the main problem -- there are only 3 input types in winapi's SendInput function:
https://learn.microsoft.com/en-us/windows/win32/api/winuser/nf-winuser-sendinput
My tool above send each input as a Unicode seqence, so it might do what you want -- paste a shit emoji to windows inputs. Two questions remain:

  1. will minecraft parse shit emoji as an input? it might, but realistically it probably will not. so i'd tried to send something that is supported by Windows as a scancode or VK that is obscure and unused
  2. how do you read the input from your gamepad in the first place?

Relevant doc about scancodes, keyboards etc: https://download.microsoft.com/download/1/6/1/161ba512-40e2-4cc9-843a-923143f3456c/scancode.doc

Alternatively, you can mess with the keyboard layout itself -- you need a tool like KbdEdit. "Examples" section contains some useful info: http://www.kbdedit.com/manual/manual_index.html

@garysassano
Copy link

I installed the utility specifically to remap the backtick symbol, as it's essential for anyone working with code and is missing from European keyboard layouts. I wanted to avoid having to use ALT + 96 every time. Unfortunately, it turns out that the one feature I needed isn't actually supported by PowerToys Keyboard Manager.

@namtab00
Copy link

namtab00 commented Aug 8, 2024

@garysassano if by any chance you're using an Italian layout keyboard, a workaround for tilde and backtick support is using this installable keyboard

@e-krebs
Copy link

e-krebs commented Aug 8, 2024

@garysassano with PowerToys Keyboard Manager you can remap a key from your keyboard.
I'm personally doing the following:
image

@garysassano
Copy link

@e-krebs It's not showing for me, I think it only allows to remap to keys from your current layout in Windows.

@jakopo87
Copy link

jakopo87 commented Aug 9, 2024

I use shortcut mappings for both backtick and tilde

immagine
immagine

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Idea-Enhancement New feature or request on an existing product Product-Keyboard Shortcut Manager Issues regarding Keyboard Shortcut Manager
Projects
None yet
Development

No branches or pull requests