Skip to content

The Customizer SpSaveItems should save the shortcut and not their text representation #124

@pyscripter

Description

@pyscripter

SpSaveItems saves spTBXItems and their shortcuts like this:

[Items]
Count=230
0=MainToolBar, tbiFileNewModule, Ctrl+N
1=MainToolBar, tbiFileOpen, Ctrl+O

There are issues with persisting shortcuts in their text representation:

ShortcutToText uses the Windows GetKeyNameText function the result of which is dependent on the active keyboard language layout.

Example:
image

Same virtual code with a russian keyboard active
image

So what you save depends on the active keyboard layout. And if you load the items when a different keyboard layout is active, shortcuts get mixed-up or lost.

Another example:

image

Another issue is that different shortcuts have the same text representation.

Example Ctrl + / (keyboard) Ctrl+ NUMPAD DIVIDE also represented as CTRL+/. But they correspond to different keys. The textual representation cannot make the distinction.

This is partially a problem of the ShortcutToText function:

image

You can see that the Hotkey control correctly differentiates, but ShortcutToText does not.

I think it more robust to save the shortcut as integers.

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