Skip to content

Keyboard layout for shortcuts #2428

Description

@RastislavKish

What is the problem or limitation you are having?

I was not sure whether to classify this as a feature request or a bug, I think it depends on the viewpoint.

Basically, right now, if I assign a hotkey for a command, say Key.MOD_1+"1", what I actually need to press to get it triggered is Ctrl+Shift+1, because the Slovak keyboard layout I'm using has the character "+" where the English keyboard has 1, and Shift+"+" produces 1 on our keyboard.

I would guess that Key.MOD_1+Key.EXCLAMATION yields a similar behavior on the English layout, i.e. you need to press Ctrl+Shift+1. Which sort of makes sense in this particular case, but normally, I would rather define this like Key.MOD_1+Key.SHIFT+"1" (it seems there is actually no value for 1 on the Key enum, I do see Key.NUMPAD_1 there but the number row is only represented by the special symbols, so this is what works instead).

Does Toga have a guidelined way of approaching this?

Describe the solution you'd like

For me personally, it makes more sense to define shortcuts through hardware keys, because various countries have very differing stickers on their keyboards, but actually very similar hardware layouts, so when I'm designing a keyboard-centric app, I can select shortcuts based on what's physically most convenient to press and makes most sense, so when my users install my app, most of them will have the fine-tuned logical control system I designed for them out of the box.

While, if I used localized shortcuts, they could be giving perfect sense on my keyboard, but be absolutely out of reah for many other countries, or not possible to press at all (like Ctrl+Ľ or Ctrl+Ô on an English keyboard).

Describe alternatives you've considered

_

Additional context

Environment

  • Operating system: Ubuntu Mate 22.04 64-bit
  • Toga: 0.4.3.dev275+g5badd9083

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew features, or improvements to existing features.
    No fields configured for issues without a type.

    Projects

    Status
    To triage

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions