Closed GiorgosXou closed 1 year ago
Remember that getch()
is really wgetch(stdscr)
. When you call wgetch()
, PDCurses moves the cursor to the spot where the input will appear (or would, if not for noecho()
... hmm). My usual advice is to alter getch()
calls to wgetch()
on the appropriate window instead. But, perhaps noecho()
should be having more of an effect here. I'll look into that...
ncurses does something different where, IIRC, it doesn't update the cursor position until there's actually input (or rather, output of that input). I intentionally didn't copy that behavior, because I thought the cursor should indicate where the input would appear. But, that really only should apply to echo mode.
@wmcbrine doing wget_wch(editorpad)
instead of get_wch()
fixed the issue with the currsor, but another issue appeared: arrow keys won't get read\captured when i do wget_wch(editorpad)
for some reason...
An issue with the arrow keys and wget_wch(editorpad)
seems to occure with NCurses
too (where it just crushes)
@wmcbrine doing
wget_wch(editorpad)
instead ofget_wch()
fixed the issue with the currsor, but another issue appeared: arrow keys won't get read\captured when i dowget_wch(editorpad)
for some reason...
Remember, keypad()
is also per-window.
Remember, keypad() is also per-window.
I wasn't aware of this, thanks!! everything works fine now.
Every time I insert a character inside the pad, for a very tiny moment of time the cursor moves where it is supposed to move and adds the charachter as it should BUT the moment after the insertion of the character, immediately after, the cursor returns back to
0,0
; when i read the position of the cursor in the pad (getyx(pad)
) the value is correct (not0,0
) but for a weird reason the cursor gets displayed at0,0
(This does not happen with stdscr or NCurses)Examples
int main( void) { int ch =-1; initscr(); noecho (); keypad(stdscr, TRUE);
}
Why I really care about this issue
I am building a prototype of a terminal based edditor for the
unicurses
library and the momment i switched fromstdscr
topads
I found out that there was this issue, and i can't figure out how to fix it and it really bothers meAny Idea?