Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

KeyBackspace is not mapped properly on Arch Linux #50

Open
ghost opened this issue Sep 1, 2018 · 4 comments
Open

KeyBackspace is not mapped properly on Arch Linux #50

ghost opened this issue Sep 1, 2018 · 4 comments

Comments

@ghost
Copy link

ghost commented Sep 1, 2018

Hi, thanks for the library.

When I press backspace, the match arm for KeyBackspace is skipped over and instead a match is found for Character('\u{7f}').

I did some research and tried running in raw mode, but there was no change in behavior.

@ghost
Copy link
Author

ghost commented Sep 3, 2018

An example.

match window.getch() {
    Some(KeyBackspace) => // not matched
    Some(Character(c)) => // matched
...

I ended up wrapping pancurses further in my application for some specialized behavior and I'm really happy with that.

Overall, great library. The firework example is especially helpful for understanding blitting characters with colors and/or to specific points on the screen.

@ignatirabo
Copy link

I just found this hapenning in Manjaro too, naturally. I guess I'll have to match the symbol manually.

@pravin
Copy link

pravin commented Sep 7, 2022

This is happening on a lot of characters, pretty much the enum Input doesn't work.

For instance, I can't get this to work

match win.getch() {
    Some(Input::Character(ch)) => {
        // Other character
    }
    Some(Input::KeyEnter) => {
        // Does not work
    }
    Some(Input::KeyDC) => {
        // Does not work
    }
    Some(_input) => continue,
    None => continue,
}

I'm using this instead now

match win.getch() {
    Some(Input::Character(ch)) => {
        if ch == '\n' { // Enter key
        }
        // Other Character
    }
    Some(_input) => continue,
    None => continue,
}

I've tried this on Windows, Mac and Linux, with the same result.

@koalanis
Copy link

I am also facing this on Mac, and Ubuntu via WSL. Pravin's approach is a good workaround.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants