Skip to content

JIS keyboard layout: intellisense accept hotkey bound to GLFW_KEY_BACKSLASH triggers on ']' instead of backslash key #513

@npg418

Description

@npg418

Summary

On JIS (Japanese 106/109) keyboard layouts, the in-game text editor’s intellisense “accept/apply suggestion” hotkey (implemented as GLFW_KEY_BACKSLASH) ends up triggering on the ] key, and the intended backslash key does not work as expected.

This makes intellisense acceptance effectively mapped to the wrong physical key on JIS keyboards.

Affected behavior

  • Intellisense suggestion list is shown
  • Pressing the physical backslash key does not accept the suggestion
  • Pressing the physical ] key does accept the suggestion (unexpected)
  • Additionally, the editor prevents typing a literal \ when using the backslash key as the intellisense accept hotkey, but when acceptance is triggered via ] on JIS layouts, ] is still inserted into the code, causing an extra unwanted character.

Screenshots

1) Before accepting (suggestion shown)
Before accepting (suggestion shown)

2) After pressing ] (suggestion accepted, but ] is also inserted)
After pressing ] (suggestion accepted, but ] is also inserted)

3) Expected result (suggestion accepted with no extra character inserted)
Expected result (accepted with no extra character inserted)

Steps to reproduce

  1. Use Windows with a JIS (Japanese 106/109) keyboard layout
  2. Open the SFM in-game program editor (text editor)
  3. Get into a state where intellisense suggestions are available/visible
  4. Press the physical backslash key -> suggestion is not accepted
  5. Press the physical ] key -> suggestion is accepted, but ] is also typed into the document

Expected behavior

The intellisense accept hotkey should be bound to the intended physical key across keyboard layouts, or be configurable, so that JIS users can use the backslash key to accept suggestions.

When the accept hotkey is used, no extra character should be inserted into the document (same behavior as the backslash key suppression logic).

Notes / possible cause

This appears to be caused by keyboard-layout differences in how GLFW key codes map to physical keys. Using a fixed GLFW_KEY_BACKSLASH check may not correspond to the backslash key on JIS layouts, and instead matches the key that produces ].

Environment

  • OS: Windows 11
  • Keyboard: JIS (Japanese 106/109)
  • ModPack: ATM 10: TTS 1.9.1
  • SFM version: 4.28.0

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions