UserInputService keycode deviations

Non-exhaustive list of keycodes that do not work as expected (on Windows).

Virtual keycode InputObject keycode(s) Expected keycode(s)
None = no event (should be) fired
VK_VOLUME_MUTE Enum.KeyCode.D None/Enum.KeyCode.Unknown
VK_VOLUME_DOWN Enum.KeyCode.C None/Enum.KeyCode.Unknown
VK_VOLUME_UP Enum.KeyCode.B None/Enum.KeyCode.Unknown
VK_MEDIA_PLAY_PAUSE Enum.KeyCode.G None/Enum.KeyCode.Unknown
VK_MEDIA_STOP Enum.KeyCode.J None/Enum.KeyCode.Unknown
VK_MEDIA_PREV_TRACK Enum.KeyCode.Q None/Enum.KeyCode.Unknown
VK_MEDIA_NEXT_TRACK Enum.KeyCode.P None/Enum.KeyCode.Unknown
VK_CLEAR Enum.Keycode.KeypadFive Enum.KeyCode.Clear
VK_APPS None Enum.KeyCode.Menu

I used @nut-tree/nut-js in a basic Node.js script.

import { Key, keyboard } from "@nut-tree-fork/nut-js";

await new Promise((resolve) => setTimeout(resolve, 1000));

await keyboard.pressKey(Key.AudioPlay);
await keyboard.releaseKey(Key.AudioPlay);

You can find the mappings from K_... to VK_... here.
Libnut to K_... here.
Nut.js to libnut here.

2 Likes

Hi @catinpsyop,

Thanks for the report! We’re aware of the issue with media keys triggering false inputs in Windows (see Media control keys also trigger normal keyboard key inputs) and have a fix in progress. As for the other two keys, could you provide your keyboard / system information so we can attempt to reproduce the issue?

1 Like

I’m running Windows 10, with a keyboard running QMK firmware.

VK_CLEAR doesn’t seem to be standard anymore (for Windows at least). Only able to repro this with the Node.js script in my original post (use Key.Clear). Might just be an OS thing…, can be ignored.

VK_APPS, QMK uses KC_APP for this keycode.
SharpKeys reads it correctly, so does this keytester. No event is fired in Roblox.


1759169597_rb7LdBf6KK
To reproduce, you can use a basic AutoHotkey script.

Sleep 2000
Send "{AppsKey}"
1 Like

Hi @catinpsyop,

Apologies for the delay here. The issues with the media control keys triggering false inputs should have been resolved. As for the Menu / VK_APPS key, we’ve specifically decided to not implement this on Windows as this key is typically intercepted by the OS on Mac and we’d like to move away from platform-dependent input behavior.

Thanks for the report again and let us know if you encounter any additional issues!

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.