Replies: 1 comment
-
|
The code of the Enter key in non-canonical mode is '\n' (== '\x0A').
|
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
zsdz
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
The doc/keyboard.txt said the return (it return means key enter?) key's code under cook mode is
^J(is ^ means key control?)I am trying write a simple editor with circle under rpi4 raw mode.most of work have been down.The code learned from https://viewsourcecode.org/snaptoken/kilo/ ,add I change the code use lib
termisowithmConsole.SetOptionskilo use this func got keyboard char enter:
then deal with the key entered:
he first handle
enterkey with'\r'.I copy the same code,but when I create a new file,type a,then enter,then type b,the screen show this:but it should be look like this:
which means after type enter,the cursor should be at the end of new line,but it add a 'space' in the first line
If I comment the kilo's code which handle the enter key:
then got the same error with my code on rpi4 bare metal.so I doubt maybe when I press enter,I can't catch it by
\rso how to catch the code when I press enter key if I set the raw mode:
mConsole.SetOptions(0);Thanks!
Beta Was this translation helpful? Give feedback.
All reactions