MOUSEHIDDEN: Difference between revisions

From QB64 Phoenix Edition Wiki
Jump to navigation Jump to search
No edit summary
No edit summary
 
(One intermediate revision by the same user not shown)
Line 28: Line 28:
File:Osx.png|'''yes'''
File:Osx.png|'''yes'''
</gallery>
</gallery>
<!-- Additional availability notes go below here -->
<!-- additional availability notes go below here -->




Line 56: Line 56:


{{PageSeeAlso}}
{{PageSeeAlso}}
* [https://qb64phoenix.com/forum/showthread.php?tid=3377 Featured in our "Keyword of the Day" series]
* [[_MOUSEHIDE]], [[_MOUSESHOW]]
* [[_MOUSEHIDE]], [[_MOUSESHOW]]




{{PageNavigation}}
{{PageNavigation}}

Latest revision as of 01:13, 14 January 2025

The _MOUSEHIDDEN function returns a boolean value according to the current mouse cursor state (hidden or visible).


Syntax

result% = _MOUSEHIDDEN


Parameters

  • result% a boolean value reflecting the current mouse cursor state:
    • is true (-1), if the mouse cursor is currently hidden
    • is false (0), if the mouse cursor is currently visible


Description

  • This function is especially useful for library code, which needs to determine the current state of the mouse cursor, which can be changed using the _MOUSEHIDE and _MOUSESHOW statements.
  • At program start the mouse cursor is visible (default), hence this function would return false (0) until the state is changed.


Availability


Examples

Example 1
Showing the different results of this function.
PRINT "Move the mouse over the program window too see the changes.": PRINT

'at program start the mouse cursor is visible
IF _MOUSEHIDDEN THEN PRINT "Mouse cursor hidden" ELSE PRINT "Mouse cursor visible"
PRINT "press any key...": SLEEP: PRINT

'now hide the mouse cursor
_MOUSEHIDE
IF _MOUSEHIDDEN THEN PRINT "Mouse cursor hidden" ELSE PRINT "Mouse cursor visible"
PRINT "press any key...": SLEEP: PRINT

'and now show it again
_MOUSESHOW
IF _MOUSEHIDDEN THEN PRINT "Mouse cursor hidden" ELSE PRINT "Mouse cursor visible"
PRINT "press any key..."

END
Example by RhoSigma


See also



Navigation:
Main Page with Articles and Tutorials
Keyword Reference - Alphabetical
Keyword Reference - By usage
Report a broken link