-
-
Notifications
You must be signed in to change notification settings - Fork 31
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added docs for sound::loaded_filename and itle_ticks() (#66)
I have added 2 new files according to the docs structure.
- Loading branch information
1 parent
6d6fe38
commit 8499aef
Showing
2 changed files
with
29 additions
and
0 deletions.
There are no files selected for viewing
4 changes: 4 additions & 0 deletions
4
doc/src/references/builtin/Audio/Classes/sound/Properties/loaded_filename.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
# loaded_filename | ||
Obtain the path of sound file that has been loaded. | ||
|
||
`string sound::loaded_filename;` |
25 changes: 25 additions & 0 deletions
25
doc/src/references/builtin/User Interface/Functions/idle_ticks.nvgt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
/* | ||
Obtain the time passed since a user has pressed a key or used the mouse. | ||
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() | ||
{ | ||
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(); | ||
} | ||
} |