Skip to content

Conversation

daviscodesbugs
Copy link
Contributor

I was running into some weirdness while running the input example where pressing Backspace on my keyboard resulted in ^? being printed. After doing some digging, I found that the value in key.cr is 0o047 which is truly the ASCII control code for backspace and I can get Backspace to print in the example with Ctrl + H on my keyboard.

After further reading, I realized the terminal is getting the ASCII control code for delete (0o117) when I press Backspace on my keyboard. This is common on modern systems as noted here. Since there is already a Delete in key.cr (the "del" key on the keyboard), I added Erase since some keyboards have that label on the backspace key.

You can see the control codes and their corresponding values here

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

Successfully merging this pull request may close these issues.

1 participant