1. Cursor in Console Window

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

new topic     » topic index » view message » categorize

2. Re: Cursor in Console Window

tbohon said...

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

new topic     » goto parent     » topic index » view message » categorize

3. Re: Cursor in Console Window

position(integer x, integer y) 

Will probably do what you want.

new topic     » goto parent     » topic index » view message » categorize

4. Re: Cursor in Console Window

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

new topic     » goto parent     » topic index » view message » categorize

Search



Quick Links

User menu

Not signed in.

Misc Menu