Skip to content

GlazeWM is a tiling window manager for macOS and Windows inspired by i3wm.

feat: add support for `henkan` and `muhenkan` keys on JP keyboards (#1182)

tanitta7755bfe0ab6e
diff --git a/README.md b/README.md
index 927d032c..1d20cea4 100644
--- a/README.md
+++ b/README.md
@@ -206,6 +206,8 @@ keybindings:
| `oem_comma` | The `,`/`<` key on a US standard keyboard (varies by keyboard) |
| `oem_minus` | The `-`/`_` key on a US standard keyboard (varies by keyboard) |
| `oem_period` | The `.`/`>` key on a US standard keyboard (varies by keyboard) |
+| `muhenkan` | The 無変換 (non-convert) key for Japanese keyboard layouts |
+| `henkan` | The 変換 (convert) key for Japanese keyboard layouts |
</details>
diff --git a/packages/wm-platform/src/keyboard_hook.rs b/packages/wm-platform/src/keyboard_hook.rs
index 2c13d738..36f2edb6 100644
--- a/packages/wm-platform/src/keyboard_hook.rs
+++ b/packages/wm-platform/src/keyboard_hook.rs
@@ -28,6 +28,7 @@ use windows::Win32::{
VK_RWIN, VK_S, VK_SCROLL, VK_SHIFT, VK_SNAPSHOT, VK_SPACE,
VK_SUBTRACT, VK_T, VK_TAB, VK_U, VK_UP, VK_V, VK_VOLUME_DOWN,
VK_VOLUME_MUTE, VK_VOLUME_UP, VK_W, VK_X, VK_Y, VK_Z,
+ VK_NONCONVERT, VK_CONVERT,
},
WindowsAndMessaging::{
CallNextHookEx, SetWindowsHookExW, UnhookWindowsHookEx, HHOOK,
@@ -295,6 +296,8 @@ impl KeyboardHook {
"oem_comma" => Some(VK_OEM_COMMA.0),
"oem_minus" => Some(VK_OEM_MINUS.0),
"oem_period" => Some(VK_OEM_PERIOD.0),
+ "muhenkan" => Some(VK_NONCONVERT.0),
+ "henkan" => Some(VK_CONVERT.0),
_ => {
// Check if the key exists on the current keyboard layout.
let utf16_key = key.encode_utf16().next()?;