1. Cursor in Console Window
- Posted by tbohon May 13, 2015
- 1286 views
Are there commands to allow me to set the cursor x and y positions within the current console window so that I can move around the screen?
TIA.
Tom
2. Re: Cursor in Console Window
- Posted by ghaberek (admin) May 13, 2015
- 1256 views
Are there commands to allow me to set the cursor x and y positions within the current console window so that I can move around the screen?
If you want to move the text cursor within the console window, use position().
If you want to move the mouse cursor on the display, that will require calling a platform-dependant system function.
On Windows, you need to call SetCursorPos() in user32.dll. I'm not sure how to do this on GTK or Linux in general.
include std/dll.e atom user32 = open_dll( "user32.dll" ) integer xSetCursorPos = define_c_proc( user32, "SetCursorPos", {C_INT,C_INT} ) public procedure SetCursorPos( integer x, integer y ) c_proc( xSetCursorPos, {x,y} ) end procedure
-Greg
3. Re: Cursor in Console Window
- Posted by irv May 13, 2015
- 1260 views
position(integer x, integer y)
Will probably do what you want.
4. Re: Cursor in Console Window
- Posted by tbohon May 13, 2015
- 1310 views
Greg, Irv: thank you so much. I'd tried setxy, setpos, locate and a half dozen other possibilities ... but didn't think about 'position' at all.
<sigh> I'm blaming my age again, OK? :)
Appreciate it guys!
Tom