ページ 11

キー入力した時

Posted: 2010年8月20日(金) 00:47
by Wグリント
右キーと左キーと他のキーを同時に押すと最後に押したボタンの処理が行われないのですが
どうしたら良いのですか?
ちなみに環境はwin7でVC++です。

良く分からないと思うので以下のコードを用意しました。

#include "DxLib.h"

int x , y ;
char Key[256] ;

int WINAPI WinMain( HINSTANCE hInstance, HINSTANCE hPrevInstance,LPSTR lpCmdLine, int nCmdShow ){

if( ChangeWindowMode(TRUE) != DX_CHANGESCREEN_OK || DxLib_Init() == -1 ) return -1 ;

while(!ProcessMessage() && !ClearDrawScreen() && !GetHitKeyStateAll( Key ) && !Key[KEY_INPUT_ESCAPE]){
if( Key[KEY_INPUT_DOWN]==1)DrawString( 0 , 0 , "下入力中" , GetColor( 255 , 255 , 255 ) );
if( Key[KEY_INPUT_RIGHT]==1)DrawString( 0 , 20 , "右入力中" , GetColor( 255 , 255 , 255 ) );
if( Key[KEY_INPUT_Z]==1)DrawString( 0 , 40 , "Z入力中" , GetColor( 255 , 255 , 255 ) );
}
DxLib_End();
return 0;
}

Re:キー入力した時

Posted: 2010年8月20日(金) 00:51
by パコネコ
キーボードが対応してないとか?

Re:キー入力した時

Posted: 2010年8月20日(金) 01:01
by Wグリント
迅速な対応ありがとうございます。
3つのゲームで試したところ
全部同じような反応をしたので
たぶんそうだと思います。