Pages: 1
Author Topic: io_handle() and io_clear()  (92,484 Views)
Offline (Unknown gender) score_under

Member
Joined: Aug 2008
Posts: 308
View profile
Posted on: August 04, 2008, 10:58:19 PM
There was a hint that it's not known what these do on the progress report.

io_clear() makes GM (or in this case, Enigma) treat all mouse buttons as released and the same with keyboard buttons.
io_handle() makes GM/Enigma re-check all buttons for the keyboard and mouse (for example, if you released a button while the window was not in focus).

Offline (Unknown gender) RetroX

Master of all things Linux
Contributor
Joined: Apr 2008
Posts: 1,055
View profile
Reply #1 Posted on: August 05, 2008, 05:13:23 PM
No, io_clear() clears the status of all keyboard and mouse keys.
io_handle() re-checks the status of the keyboard and mouse keys.

It wasn't that they didn't know what they did, it was that they thought that they were worthless functions and didn't understand why they were there.
Offline (Unknown gender) sprintf()

Past Contributor
Joined: Apr 2008
Posts: 72
View profile
Reply #2 Posted on: August 05, 2008, 05:48:29 PM
They're useful for checking input for interrupting a loop. For example:

while(1) {
    io_handle();

    if(keyboard_check(vk_escape))
        break;
}

Because GM only normally checks the buffers once per step.
Offline (Unknown gender) serprex

Smooth ER
Developer
Joined: Apr 2008
Posts: 106
View profile WWW
Reply #3 Posted on: August 21, 2008, 12:14:55 AM
Ya, I have to use io_handle() in my room code menus and io_clear() because GM doesn't clean keyboard_check_pressed with io_handle()
Offline (Unknown gender) Josh @ Dreamland

Prince of all Goldfish
Developer
Joined: Feb 2008
Posts: 2,950
View profile
Reply #4 Posted on: April 03, 2009, 02:14:26 AM
Mark threads all this stuff anyway. Create a code that draws thousands of lines towards the mouse, and move the mouse around. Half the lines will follow the mouse.
Offline (Unknown gender) RetroX

Master of all things Linux
Contributor
Joined: Apr 2008
Posts: 1,055
View profile
Reply #5 Posted on: April 03, 2009, 11:51:17 PM
Quote from: sprintf() on August 05, 2008, 05:48:29 PM
while(1) {
    io_handle();

    if(keyboard_check(vk_escape))
        break;
}
keyboard_check_direct()
Offline (Unknown gender) sprintf()

Past Contributor
Joined: Apr 2008
Posts: 72
View profile
Reply #6 Posted on: April 04, 2009, 04:45:31 AM
Fuck you RetroX!
Live in the now!
Offline (Unknown gender) Josh @ Dreamland

Prince of all Goldfish
Developer
Joined: Feb 2008
Posts: 2,950
View profile
Reply #7 Posted on: April 20, 2009, 08:13:51 PM
And that.
Offline (Unknown gender) score_under

Member
Joined: Aug 2008
Posts: 308
View profile
Reply #8 Posted on: April 21, 2009, 05:39:31 PM
keyboard_check_direct actually detects input from outside the window, which may not be what you want.
Offline (Unknown gender) notachair

Definitely not a chair
Contributor
Joined: Feb 2008
Posts: 299
View profile
Reply #9 Posted on: April 22, 2009, 12:01:07 AM
Quote from: score_under on April 21, 2009, 05:39:31 PM
keyboard_check_direct actually detects input from outside the window, which may not be what you want.
D: keyloggers
Offline (Unknown gender) skarik

Member
Joined: Jul 2008
Posts: 46
View profile WWW
Reply #10 Posted on: May 13, 2009, 04:52:54 AM
No way. There's an io_handle?
Offline (Unknown gender) score_under

Member
Joined: Aug 2008
Posts: 308
View profile
Reply #11 Posted on: May 13, 2009, 09:00:30 PM
Quote from: skarik on May 13, 2009, 04:52:54 AM
No way. There's an io_handle?

Evidently.
Pages: 1