Skip to main content
gamedev.net
🔒 Locked

Typing with direct input

Started by TonyFish Apr 11, 2001 at 5:24 AM 0 replies 350+ views
Original Post
TonyFish
TonyFish
Hi, I''m writing a 3d engine and have got to the state where I need to input text into the environment. I''m using Direct Input to control my player''s movement etc.. but as soon as I enter ''text input mode'' the keyboard input continues at the speed of the game.. in other words when I type a character it prints out 5 times even though I''ve just hit it not held it down. Also if I hit a number of keys at the same time they ALL print out rather than just the last one to be pressed. I''ve tried using the WndProc appraoch too but I get similar results... Help !!!! [-T-] Out
<Fish>{
CrazySwede
CrazySwede
Hi!

In my input class I have an array like this.

bUpLast[255]

my functions then work like this

-------------------------------

KeyDown(key)
{
return dxinput.keydown(key)
}

KeyPressed(key)
{
if dxinput.keydown(key)
{
  if bUpLast[key] = true
  {
   bUpLast[key] = false
   return true
  }
} else {
  bUpLast[key] = true
}
return false
}

-------------------------------

Then I use KeyDown for movement and things and KeyPressed for text input and menu movement.

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.