Re: Cursor in Console Window

new topic     » goto parent     » topic index » view thread      » older message » newer message
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 thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu