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

Summary: switching CAPS and NUM does not work.
Product: SDL Reporter: Andrey <public.irkutsk>
Component: eventsAssignee: Sam Lantinga <slouken>
Status: RESOLVED INVALID QA Contact: Sam Lantinga <slouken>
Severity: normal    
Priority: P2    
Version: HG 2.1   
Hardware: x86   
OS: Linux   

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