-
|
Sample 8 can enable the usbkeyboard,and echo the typed letter on screen I want to write an "Echo Server",when user typed a line,the server will echo the while line,so I change the sample 8 code: declare in class CKernel then and add in function before if got key not equal '\n',strcat it,else write it on screen and clear the buffer. the prog works fine,but I write it in the call-back function KeyPressedHandler.I want write the logic in the "main function",in circle it should be the function,like write in c,I can write it in the main function.After all I can't always put the logic code in the call-back function How to do this?Thanks! |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 2 replies
-
|
There is a class CConsole, which allows to input a line via an USB keyboard or other device with echo.
|
Beta Was this translation helpful? Give feedback.

There is a class CConsole, which allows to input a line via an USB keyboard or other device with echo.
scanf()andprintf()is not available in Circle itself, but the circle-stdlib project adds it to Circle. You can also usefgets()with it to read a line from the keyboard.