Wrecked Games
September 10, 2010, 09:46:47 AM
Welcome,
Guest
. Please
login
or
register
.
Did you miss your
activation email?
1 Hour
1 Day
1 Week
1 Month
Forever
Login with username, password and session length
News
: We're just that awesome.
Home
Help
Search
Members
Login
Register
Wrecked Games
>
Wreckedgames Libraries
>
OIS
>
Key Repeat in Windows
Pages: [
1
]
« previous
next »
Print
Author
Topic: Key Repeat in Windows (Read 195 times)
frier
Newbie
Posts: 4
Key Repeat in Windows
«
on:
June 30, 2010, 10:24:49 AM »
Was reading through the forums and saw OIS didn't have a key repeat feature for windows. So I'm looking into coding it myself for my player movement. Because at the moment to move the camera forward you have to press 'W' over and over. (actually maybe I could just implement it so when keyReleased triggers then I stop moving, instead of when the button is down, for every 30 millisecond tick, move forward)
So I started implementing the timer so it repeats say every 30 milliseconds. But now I'm up to the part where, how do I tell OIS to fire my keyPressed function in my EventHandler if the button is still pressed?
Also am I right to think that the capture() in the OIS Object checks if input has changed then fires my eventHander? I could also use the copyKeyStates function for the keyboard and write my own lil event handler with keyrepeats. What do you guys recommend?
Logged
pjcast
Administrator
Veteran
Posts: 2547
Re: Key Repeat in Windows
«
Reply #1 on:
July 03, 2010, 09:02:43 PM »
I don't recommend injecting keys into OIS. It is simply not designed for that. Your first guess, is actually the best way to handle it. Simply use a value to apply to your movement every update frame that is triggered from keypresses/keyreleases. Key repeats would not help with this, repeats are mainly only useful for text input.
Logged
Pages: [
1
]
Print
« previous
next »
Jump to:
Please select a destination:
-----------------------------
Wreckedgames Libraries
-----------------------------
=> WGE
=> Ringo
=> Visual Ogre Studio
=> OIS
=> OIS Development
=> Theora Plugin
=> Projects Showcase
-----------------------------
Everything Else
-----------------------------
=> WreckedGames
Loading...