Skip to content

Keybindings config character uppercase #512

@xsebek

Description

@xsebek

I accidentally wrote a keybinding in uppercase, like Ctrl-T, and it turns out this means it parses successfully, with no errors or warnings, but simply does not work --- both Ctrl-t and Ctrl-Shift-t do nothing. I suspect it turns into a keybinding which is impossible to ever see, because Ctrl-Shift-t is not the same as Ctrl-T. Well, I don't know, perhaps it is possible to get Ctrl-T by turning on caps lock and then typing Ctrl-t? In any case it seems like some kind of warning here would be nice.

@byorgey in swarm-game/swarm#1979 (comment)


I am also confused by the behavior. Neither the Brick nor Vty documentation specifies what the case should be.

I suspect this code:

pKey t
| T.length t == 1 =
return (Vty.KChar $ T.last s)

Should use the lowercase t instead of the original s text:

        pKey t
          | [c] <- T.unpack t = return (Vty.KChar c)

Either way, I tried configuring a keybinding with Ctrl and Shift and could not get it to run:

; these do not seem to work
pause = S-C-P,S-C-p,C-P,S-P,S-p
; without shift it works
pause = C-p

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