Pages: [1]
  Print  
Author Topic: io_handle() and io_clear()  (Read 5049 times)
Offline (Unknown gender) score_under
Posted on: August 04, 2008, 05:58:19 PM

Member
Joined: Aug 2008
Posts: 308

View Profile
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).

Logged
Offline (Male) RetroX
Reply #1 Posted on: August 05, 2008, 12:13:23 PM

Master of all things Linux
Contributor
Location: US
Joined: Apr 2008
Posts: 1055
MSN Messenger - classixretrox@gmail.com
View Profile Email
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.
Logged
My Box: Phenom II 3.4GHz X4 | ASUS ATI RadeonHD 5770, 1GB GDDR5 RAM | 1x4GB DDR3 SRAM | Arch Linux, x86_64 (Cube) / Windows 7 x64 (Blob)
Quote from: Fede-lasse
Why do all the pro-Microsoft people have troll avatars? :(
Offline (Male) sprintf()
Reply #2 Posted on: August 05, 2008, 12:48:29 PM

"Past Contributor"
Location: S. Wales
Joined: Apr 2008
Posts: 72
MSN Messenger - dmgoron@gmail.com
View Profile Email
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.
Logged
Offline (Female) serprex
Reply #3 Posted on: August 20, 2008, 07:14:55 PM
Smooth ER
Developer
Joined: Apr 2008
Posts: 106

View Profile WWW
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()
Logged
Offline (Male) Josh @ Dreamland
Reply #4 Posted on: April 02, 2009, 09:14:26 PM

Prince of all Goldfish
Developer
Location: Ohio, United States
Joined: Feb 2008
Posts: 2946

View Profile Email
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.
Logged
"That is the single most cryptic piece of code I have ever seen." -Master PobbleWobble
"I disapprove of what you say, but I will defend to the death your right to say it." -Evelyn Beatrice Hall, Friends of Voltaire
Offline (Male) RetroX
Reply #5 Posted on: April 03, 2009, 06:51:17 PM

Master of all things Linux
Contributor
Location: US
Joined: Apr 2008
Posts: 1055
MSN Messenger - classixretrox@gmail.com
View Profile Email
while(1) {
    io_handle();

    if(keyboard_check(vk_escape))
        break;
}
keyboard_check_direct()
Logged
My Box: Phenom II 3.4GHz X4 | ASUS ATI RadeonHD 5770, 1GB GDDR5 RAM | 1x4GB DDR3 SRAM | Arch Linux, x86_64 (Cube) / Windows 7 x64 (Blob)
Quote from: Fede-lasse
Why do all the pro-Microsoft people have troll avatars? :(
Offline (Male) sprintf()
Reply #6 Posted on: April 03, 2009, 11:45:31 PM

"Past Contributor"
Location: S. Wales
Joined: Apr 2008
Posts: 72
MSN Messenger - dmgoron@gmail.com
View Profile Email
Fuck you RetroX!
Live in the now!
Logged
Offline (Male) Josh @ Dreamland
Reply #7 Posted on: April 20, 2009, 03:13:51 PM

Prince of all Goldfish
Developer
Location: Ohio, United States
Joined: Feb 2008
Posts: 2946

View Profile Email
And that.
Logged
"That is the single most cryptic piece of code I have ever seen." -Master PobbleWobble
"I disapprove of what you say, but I will defend to the death your right to say it." -Evelyn Beatrice Hall, Friends of Voltaire
Offline (Unknown gender) score_under
Reply #8 Posted on: April 21, 2009, 12:39:31 PM

Member
Joined: Aug 2008
Posts: 308

View Profile
keyboard_check_direct actually detects input from outside the window, which may not be what you want.
Logged
Offline (Male) notachair
Reply #9 Posted on: April 21, 2009, 07:01:07 PM

Definitely not a chair
Contributor
Joined: Feb 2008
Posts: 300

View Profile
keyboard_check_direct actually detects input from outside the window, which may not be what you want.
D: keyloggers
Logged
Offline (Unknown gender) skarik
Reply #10 Posted on: May 12, 2009, 11:52:54 PM

Member
Joined: Jul 2008
Posts: 46

View Profile WWW Email
No way. There's an io_handle?
Logged
~~
Offline (Unknown gender) score_under
Reply #11 Posted on: May 13, 2009, 04:00:30 PM

Member
Joined: Aug 2008
Posts: 308

View Profile
No way. There's an io_handle?

Evidently.
Logged
Pages: [1]
  Print