Skip to content

Commit

Permalink
Minor doc formatting.
Browse files Browse the repository at this point in the history
  • Loading branch information
TheQuinbox committed Jun 19, 2024
1 parent 8499aef commit 9a898c8
Showing 1 changed file with 2 additions and 5 deletions.
Original file line number Diff line number Diff line change
@@ -1,25 +1,22 @@
/*
Obtain the time passed since a user has pressed a key or used the mouse.
uint64 idle_ticks()
uint64 idle_ticks();
## returns
Returns the number of milliseconds since a user has not interacted with the machine.
## remarks
This function can serve as a useful utility to verify whether a user has been away from the keyboard.
*/

// Example
void main()
{
void main() {
int64 t;

show_window("Idle test");
wait(50);
screen_reader_speak("Press space to check the idle time and escape to exit.", true);
while (!key_pressed(KEY_ESCAPE)) {
wait(5);
if (key_pressed(KEY_SPACE))
screen_reader_speak("You have been idle for %0 milliseconds".format(t), true);

t = idle_ticks();
}
}

0 comments on commit 9a898c8

Please sign in to comment.