Beefy Boxes and Bandwidth Generously Provided by pair Networks
go ahead... be a heretic
 
PerlMonks  

How to get current cursor position on Windows command prompt

by tarunmudgal4u (Sexton)
on Sep 30, 2013 at 06:48 UTC ( #1056292=perlquestion: print w/ replies, xml ) Need Help??
tarunmudgal4u has asked for the wisdom of the Perl Monks concerning the following question:

Hi Monks, I'm working on a script wherein I want to check the current cursor position on the console whether it's at the beginning of the line or somewhere in between.

I tried using tell function but it returns total bytes rather coordinates. If I can get cursor coordinates somehow, I would be able to check the x coordinate and confirm if cursor it at the beginning of the line or not.

Please let me know your suggestions on this

Comment on How to get current cursor position on Windows command prompt
Re: How to get current cursor position on Windows command prompt
by davido (Archbishop) on Sep 30, 2013 at 06:58 UTC

    Win32::Console: ($x, $y, $size, $visible) = $CONSOLE->Cursor();. I don't use Windows much anymore, but the module looks very useful for 1980's style user interfaces. ;)


    Dave

Re: How to get current cursor position on Windows command prompt
by Marshall (Prior) on Sep 30, 2013 at 08:19 UTC
    I ask what application you are trying to accomplish?

    Can you describe this more?

    A normal command prompt application allows you to edit the input (backspace or insert/delete) and then hit "return" and the command executes.

    The normal idea of a command line is that you edit the command and then "hit enter". What is what you want different than that?

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: perlquestion [id://1056292]
Approved by Corion
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others imbibing at the Monastery: (6)
As of 2014-09-19 22:21 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    How do you remember the number of days in each month?











    Results (149 votes), past polls