Multimedia Key Hotkey Support #13753

Closed
opened 2026-01-31 03:51:10 +00:00 by claunia · 5 comments
Owner

Originally created by @allquixotic on GitHub (May 9, 2021).

Description of the new feature/enhancement

In the documentation at https://docs.microsoft.com/en-us/windows/terminal/customize-settings/actions#accepted-modifiers-and-keys the listed keys are:

Type | Keys
-- | --
Function and alphanumeric keys | f1-f24, a-z, 0-9
Symbols | `, plus, -, =, [, ], \, ;, ', ,, ., /
Arrow keys | down, left, right, up, pagedown, pageup, pgdn, pgup, end, home
Action keys | tab, enter, esc, escape, space, backspace, delete, insert, app, menu
Numpad keys | numpad_0-numpad_9, numpad0-numpad9, numpad_add, numpad_plus, numpad_decimal, numpad_period, numpad_divide, numpad_minus, numpad_subtract, numpad_multiply

The Back, Forward, and other multimedia keys are not mentioned. I have a TEX Shinobi and would like to bind the "Back" and "Forward" keys to previous/next tab. I had this working 10 years ago in gnome-terminal; would be nice to have this on Windows by now. :)

The nice thing about being able to use Back and Forward specifically for this is because those keys are already useful in web browsers to do what you would expect, so I don't have to write an AutoHotkey macro or rebind the behavior of the keys at the hardware level to get this working in both Terminal and on the web.

Proposed technical implementation details (optional)

Not sure exactly, but I believe the multimedia keys have normal key codes, at least on Windows. PassMark KeyboardTest reports "Windows Key Code" 0xA6 (decimal 166) for Back and 0xA7 / decimal 167 for Forward. Not sure if they are handled the same way as other keys, since no "BIOS Key Code" gets sent. I've always suspected something was a little weird / non-standard about multimedia keys.

Originally created by @allquixotic on GitHub (May 9, 2021). # Description of the new feature/enhancement In the documentation at https://docs.microsoft.com/en-us/windows/terminal/customize-settings/actions#accepted-modifiers-and-keys the listed keys are: ``` Type | Keys -- | -- Function and alphanumeric keys | f1-f24, a-z, 0-9 Symbols | `, plus, -, =, [, ], \, ;, ', ,, ., / Arrow keys | down, left, right, up, pagedown, pageup, pgdn, pgup, end, home Action keys | tab, enter, esc, escape, space, backspace, delete, insert, app, menu Numpad keys | numpad_0-numpad_9, numpad0-numpad9, numpad_add, numpad_plus, numpad_decimal, numpad_period, numpad_divide, numpad_minus, numpad_subtract, numpad_multiply ``` The `Back`, `Forward`, and other multimedia keys are not mentioned. I have a TEX Shinobi and would like to bind the "Back" and "Forward" keys to previous/next tab. I had this working 10 years ago in gnome-terminal; would be nice to have this on Windows by now. :) The nice thing about being able to use Back and Forward specifically for this is because those keys are already useful in web browsers to do what you would expect, so I don't have to write an AutoHotkey macro or rebind the behavior of the keys at the hardware level to get this working in both Terminal and on the web. # Proposed technical implementation details (optional) Not sure exactly, but I believe the multimedia keys have normal key codes, at least on Windows. PassMark KeyboardTest reports "Windows Key Code" 0xA6 (decimal 166) for Back and 0xA7 / decimal 167 for Forward. Not sure if they are handled the same way as other keys, since no "BIOS Key Code" gets sent. I've always suspected something was a little weird / non-standard about multimedia keys.
Author
Owner

@zadjii-msft commented on GitHub (May 11, 2021):

Hmm. I'd bet those keys are

name hex description
VK_BROWSER_BACK 0xA6 Browser Back key
VK_BROWSER_FORWARD 0xA7 Browser Forward key
VK_BROWSER_REFRESH 0xA8 Browser Refresh key
VK_BROWSER_STOP 0xA9 Browser Stop key
VK_BROWSER_SEARCH 0xAA Browser Search key
VK_BROWSER_FAVORITES 0xAB Browser Favorites key
VK_BROWSER_HOME 0xAC Browser Start and Home key

Doesn't seem totally unreasonable to add those. We'd need to come up with sensible names for those keys, but then they could be added pretty easily.

@zadjii-msft commented on GitHub (May 11, 2021): Hmm. I'd bet those keys are name | hex | description -- | -- | -- VK_BROWSER_BACK | 0xA6 | Browser Back key VK_BROWSER_FORWARD | 0xA7 | Browser Forward key VK_BROWSER_REFRESH | 0xA8 | Browser Refresh key VK_BROWSER_STOP | 0xA9 | Browser Stop key VK_BROWSER_SEARCH | 0xAA | Browser Search key VK_BROWSER_FAVORITES | 0xAB | Browser Favorites key VK_BROWSER_HOME | 0xAC | Browser Start and Home key Doesn't seem totally unreasonable to add those. We'd need to come up with sensible names for those keys, but then they could be added pretty easily.
Author
Owner

@allquixotic commented on GitHub (May 11, 2021):

For the docs / name for each key, how about

  • Add a new type of key: Multimedia keys
  • Name them as follows: back, forward, refresh, stop, search, favorites, start

Obviously VK_BROWSER_HOME can't map to "home" since that's already another key.

If that sounds good to you, I can work on a PR. C++ is like my third strongest language, but I should definitely be able to make such an easy change.

@allquixotic commented on GitHub (May 11, 2021): For the docs / name for each key, how about - Add a new type of key: **Multimedia keys** - Name them as follows: back, forward, refresh, stop, search, favorites, start Obviously `VK_BROWSER_HOME` can't map to "home" since that's already another key. If that sounds good to you, I can work on a PR. C++ is like my third strongest language, but I should definitely be able to make such an easy change.
Author
Owner

@zadjii-msft commented on GitHub (May 12, 2021):

I'd probably go with

browser_back
browser_forward
browser_refresh
browser_stop
browser_search
browser_favorites
browser_home

I'd be a little worried with back maybe being confusing, and start might be confusing with the win key as well. At least that's got parity with the actual VKEY constants, so that makes sense to me. I'm pretty sure the only file you'll need to edit is src\cascadia\TerminalSettingsModel\KeyChordSerialization.cpp. @carlos-zamora can correct me if I'm wrong here.

@zadjii-msft commented on GitHub (May 12, 2021): I'd probably go with ``` browser_back browser_forward browser_refresh browser_stop browser_search browser_favorites browser_home ``` I'd be a little worried with `back` maybe being confusing, and `start` might be confusing with the `win` key as well. At least that's got parity with the actual VKEY constants, so that makes sense to me. I'm pretty sure the only file you'll need to edit is `src\cascadia\TerminalSettingsModel\KeyChordSerialization.cpp`. @carlos-zamora can correct me if I'm wrong here.
Author
Owner

@KalleOlaviNiemitalo commented on GitHub (May 15, 2021):

Please edit doc/cascadia/profiles.schema.json as well.

@KalleOlaviNiemitalo commented on GitHub (May 15, 2021): Please edit [doc/cascadia/profiles.schema.json](https://github.com/microsoft/terminal/blob/66fdc645f748bfc4fe4ba8f123469de0ce2a66a3/doc/cascadia/profiles.schema.json#L6-L10) as well.
Author
Owner

@ghost commented on GitHub (Aug 31, 2021):

:tada:This issue was addressed in #10801, which has now been successfully released as Windows Terminal Preview v1.11.2421.0.🎉

Handy links:

@ghost commented on GitHub (Aug 31, 2021): :tada:This issue was addressed in #10801, which has now been successfully released as `Windows Terminal Preview v1.11.2421.0`.:tada: Handy links: * [Release Notes](https://github.com/microsoft/terminal/releases/tag/v1.11.2421.0) * [Store Download](https://www.microsoft.com/store/apps/9n8g5rfz9xk3?cid=storebadge&ocid=badge)
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#13753