0

Have no clue, I read How do i read single character input from keyboard (键盘) using nasm (assembly) under ubuntu?, and I can't write executable program.

My expected effect is:

> ./program
  please input some character: abcdefg
  abcdefg

I examined ioctl syscall, and use man termios, but I can't found about the second parameter cmd introduction, such as TCGETS 0x5401, and I don't know how to use it.

OnlyWick
  • 342
  • 2
  • 10
  • 1
    It's quite complicated to read the keyboard *directly* (`/dev/event/`something), equally hard to draw on the screen. Normally you just `read()` stdin and `write()` stdout, letting a terminal or terminal emulator turn key codes into characters. i.e. you implement `cat`, or one system call of it. – Peter Cordes Jun 24 '22 at 08:16
  • @PeterCordes yeah, I just want to `read()` stdin and `write()` stdout, but I can't Implement it also! – OnlyWick Jun 24 '22 at 08:23

0 Answers0