呀。沒有鍵盤,ncurses不會爲你處理轉義碼。從鍵盤手冊頁:
The keypad option enables the keypad of the user's terminal. If en-
abled (bf is TRUE), the user can press a function key (such as an arrow
key) and wgetch returns a single value representing the function key,
as in KEY_LEFT. If disabled (bf is FALSE), curses does not treat func-
tion keys specially and the program has to interpret the escape se-
quences itself. If the keypad in the terminal can be turned on (made
to transmit) and off (made to work locally), turning on this option
causes the terminal keypad to be turned on when wgetch is called. The
default value for keypad is false.
通常情況下,我在ncurses的程序做的第一件事就是調用鍵盤(stdscr上,真),以實現漂亮的鍵盤映射。
希望有所幫助。
因此,我在這裏不理解的是它爲什麼在兩次按鍵後「修復」自身。 – 2009-07-28 15:39:55