We are currently migrating Bugzilla to GitHub issues.
Any changes made to the bug tracker now will be lost, so please do not post new bugs or make changes to them.
When we're done, all bug URLs will redirect to their equivalent location on the new bug tracker.

Bug 4812 - switching CAPS and NUM does not work.
Summary: switching CAPS and NUM does not work.
Status: RESOLVED INVALID
Alias: None
Product: SDL
Classification: Unclassified
Component: events (show other bugs)
Version: HG 2.1
Hardware: x86 Linux
: P2 normal
Assignee: Sam Lantinga
QA Contact: Sam Lantinga
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2019-10-02 10:31 UTC by Andrey
Modified: 2019-10-02 11:25 UTC (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Andrey 2019-10-02 10:31:22 UTC
In the current version of the code, switching the state for the CAPS and NUM buttons occurs when the button is pressed, and when the button is released, this state is reset.

[code]
    if (SDL_KEYDOWN == type) {
        switch (keycode) {
        case SDLK_NUMLOCKCLEAR:
            keyboard->modstate ^= KMOD_NUM;
            break;
        case SDLK_CAPSLOCK:
            keyboard->modstate ^= KMOD_CAPS;
            break;
        default:
            keyboard->modstate |= modifier;
            break;
        }
    } else {
        // CAPS keyup reset state
        keyboard->modstate &= ~modifier;
    }
[/code]
Comment 1 Andrey 2019-10-02 11:18:52 UTC
.
Comment 2 Andrey 2019-10-02 11:25:54 UTC
setxkbmap fault