Click here to Skip to main content
15,914,447 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: How to respond VK_LEFT and VK_DOWN at the same time? Pin
BlackDice17-Jun-05 2:54
BlackDice17-Jun-05 2:54 
GeneralRe: How to respond VK_LEFT and VK_DOWN at the same time? Pin
simon wan17-Jun-05 14:44
simon wan17-Jun-05 14:44 
AnswerRe: How to respond VK_LEFT and VK_DOWN at the same time? Pin
David Crow17-Jun-05 3:31
David Crow17-Jun-05 3:31 
GeneralRe: How to respond VK_LEFT and VK_DOWN at the same time? Pin
BlackDice17-Jun-05 4:54
BlackDice17-Jun-05 4:54 
GeneralRe: How to respond VK_LEFT and VK_DOWN at the same time? Pin
David Crow17-Jun-05 5:14
David Crow17-Jun-05 5:14 
GeneralRe: How to respond VK_LEFT and VK_DOWN at the same time? Pin
BlackDice17-Jun-05 5:20
BlackDice17-Jun-05 5:20 
GeneralRe: How to respond VK_LEFT and VK_DOWN at the same time? Pin
David Crow17-Jun-05 5:24
David Crow17-Jun-05 5:24 
GeneralRe: How to respond VK_LEFT and VK_DOWN at the same time? Pin
BlackDice17-Jun-05 5:32
BlackDice17-Jun-05 5:32 
Well, I wasn't actually using DirectInput. But this was more a Windows program with the keydown being handled in the message loop. Something like this:

if(GetAsyncKeyState(VK_LEFT)
    m_object.left -= .01.
if(GetAsyncKeyState(VK_RIGHT)
    m_object.left += .01.
if(GetAsyncKeyState(VK_UP)
    m_object.top -= .01.
if(GetAsyncKeyState(VK_DOWN)
    m_object.top += .01.

DrawScene();

at any time if you check the GetAsyncKeyState() function (there's also an additional parameter that escapes me right now), any key that is pressed will return true

My articles

www.stillwaterexpress.com

BlackDice
GeneralRe: How to respond VK_LEFT and VK_DOWN at the same time? Pin
Toby Opferman23-Jun-05 10:44
Toby Opferman23-Jun-05 10:44 
AnswerRe: How to respond VK_LEFT and VK_DOWN at the same time? Pin
Bob Stanneveld17-Jun-05 3:38
Bob Stanneveld17-Jun-05 3:38 
GeneralMapping a network drive programmatically Pin
Still learning how to code17-Jun-05 2:15
Still learning how to code17-Jun-05 2:15 
GeneralRe: Mapping a network drive programmatically Pin
David Crow17-Jun-05 2:22
David Crow17-Jun-05 2:22 
GeneralNon MFC X-Y Plots Pin
jerry1211a17-Jun-05 1:59
jerry1211a17-Jun-05 1:59 
GeneralRe: Non MFC X-Y Plots Pin
toxcct17-Jun-05 2:01
toxcct17-Jun-05 2:01 
GeneralRe: Non MFC X-Y Plots Pin
Ravi Bhavnani17-Jun-05 4:50
professionalRavi Bhavnani17-Jun-05 4:50 
QuestionHow to call VB DLL in C code ( VC environment) Pin
Tuscon17-Jun-05 1:04
Tuscon17-Jun-05 1:04 
AnswerRe: How to call VB DLL in C code ( VC environment) Pin
David Crow17-Jun-05 2:23
David Crow17-Jun-05 2:23 
AnswerRe: How to call VB DLL in C code ( VC environment) Pin
Mike Dimmick17-Jun-05 2:28
Mike Dimmick17-Jun-05 2:28 
GeneralShared data problem, use of #pragma data_seg() Pin
Vaibhav Sanghavi17-Jun-05 0:55
Vaibhav Sanghavi17-Jun-05 0:55 
GeneralRe: Shared data problem, use of #pragma data_seg() Pin
Blake Miller17-Jun-05 6:53
Blake Miller17-Jun-05 6:53 
GeneralRe: Shared data problem, use of #pragma data_seg() Pin
Vaibhav Sanghavi20-Jun-05 2:27
Vaibhav Sanghavi20-Jun-05 2:27 
GeneralC++ file I/O Pin
Hachaso17-Jun-05 0:49
Hachaso17-Jun-05 0:49 
GeneralRe: C++ file I/O Pin
toxcct17-Jun-05 0:59
toxcct17-Jun-05 0:59 
GeneralRe: C++ file I/O Pin
xiaohe52117-Jun-05 1:14
xiaohe52117-Jun-05 1:14 
GeneralRe: C++ file I/O Pin
toxcct17-Jun-05 1:24
toxcct17-Jun-05 1:24 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.