Beefy Boxes and Bandwidth Generously Provided by pair Networks
Come for the quick hacks, stay for the epiphanies.
 
PerlMonks  

comment on

( [id://3333]=superdoc: print w/replies, xml ) Need Help??
It took me a while to figure that one out as well. It's the character-based y coordinate relative to the first (top) line of text in the console, assuming your scroll bar is at the very top. So if your window is 25 lines tall but your history is 50 characters tall total, then if you scroll to the top , it will say the y is line 0, and if you scroll to the bottom, it will say the line is 49.

When I originally had a \n in my ->Write() string, I was confused why the y coordinate would start increasing and "never" stop, even as I moved the cursor back up the screen. So I changed it to a \r instead, so the text wouldn't scroll the screen, and it suddenly made perfect sense, as I manually scrolled or intentionally moved down a line for printing (typing an ENTER, because the keyboard events still kept \n). (I also didn't realize until I did that -- though it should have been obvious, even from the x coordinate -- that the coordinates were in characters, not in pixels.)


update: My original reply was assuming you were talking about the mouse coordinates from @console_events. Sorry I misread. But yes, the current x and current y, in the info array as well, are still relative to the top-left of the whole buffer, so the whole size and current location can be outside the window dimensions.


In reply to Re^3: Unable to capture mouse events in Win32::Console by pryrt
in thread Unable to capture mouse events in Win32::Console by fireblood

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":



  • Are you posting in the right place? Check out Where do I post X? to know for sure.
  • Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
    <code> <a> <b> <big> <blockquote> <br /> <dd> <dl> <dt> <em> <font> <h1> <h2> <h3> <h4> <h5> <h6> <hr /> <i> <li> <nbsp> <ol> <p> <small> <strike> <strong> <sub> <sup> <table> <td> <th> <tr> <tt> <u> <ul>
  • Snippets of code should be wrapped in <code> tags not <pre> tags. In fact, <pre> tags should generally be avoided. If they must be used, extreme care should be taken to ensure that their contents do not have long lines (<70 chars), in order to prevent horizontal scrolling (and possible janitor intervention).
  • Want more info? How to link or How to display code and escape characters are good places to start.
Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others about the Monastery: (3)
As of 2024-04-25 16:47 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found