Skip to content

input doesn't handle NUM_LOCK properly on Windows #485

@strager

Description

@strager

Describe the bug

Text is "" if numlock is enabled on the keyboard.

Culprit:

x/input/driver_windows.go

Lines 468 to 471 in 19b66ab

if cks == 0 ||
cks == xwindows.SHIFT_PRESSED ||
cks == xwindows.CAPSLOCK_ON ||
altGr {

cks is 0x20 (I think) when numlock is pressed.

Setup

  • Windows 10
  • Windows Terminal

To Reproduce

I tested with github.com/stt/opencode. I can't type into the prompt box unless I turn off numlock on my keyboard.

Source Code

I don't have a minimal repro, sorry.

Expected behavior

numlock should not affect the input of normal characters (a-z keys).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions