_MOUSEY - mkilgore/QB64pe GitHub Wiki
The _MOUSEY function returns the current vertical (row) mouse cursor position when read after _MOUSEINPUT.
- pixelRow% = _MOUSEY
- SCREEN 0 returns the INTEGER vertical text row position (from build 20170817/62 onward); older versions return a SINGLE vertical text row position. Use INTEGER variables to avoid floating decimal returns.
- Graphic screen modes 1, 2 and 7 to 13 and _NEWIMAGE 32 bit return the INTEGER pixel columns.
- To calculate text rows in graphic modes divide the return by 16 or the _FONTHEIGHT of _FONT characters.
- _MOUSEINPUT must be used to detect any changes in the mouse position and is required for any coordinate returns.
- In SCREEN 0, QBasic's ABSOLUTE returned graphic coordinates. QB64 mouse functions return the text coordinates.
Example: Highlighting a row of text in Screen 0.
SUB SelectRow (y, x1, x2, col) DEF SEG = &HB800 addr& = (x1 - 1 + (y - 1) * _WIDTH (function)) * 2 + 1 FOR x = x1 TO x2 oldCol = PEEK(addr&) AND (boolean) &B10001111 ' Mask foreground color and blink bit POKE addr&, oldCol OR ((col AND (boolean) &B111) * &B10000) ' Apply background color addr& = addr& + 2 NEXT END SUB '' '' |
- _MOUSEX, _MOUSEBUTTON, _MOUSEWHEEL
- _MOUSEINPUT, _MOUSEMOVE
- _MOUSESHOW, _MOUSEHIDE
- _MOUSEMOVEMENTX, _MOUSEMOVEMENTY (relative pointer moves)
- Controller Devices
Navigation:
Go to Keyword Reference - Alphabetical
Go to Keyword Reference - By usage
Go to Main WIKI Page