키보드의 'k'키를 누르면
방향키 아래, z키를 차례대로 입력하는 프로그램을 만들려고 하는데
명령어를 못찾겠어요...
어떻게 하면 되나요??
2011.12.19 16:47:25 *.136.209.2
안녕하세요 야리싸내입니다.
아래의 함수를 사용하시면 됩니다.
FakeKeystroke (int keyCode);
Purpose
Simulates a keystroke by posting a keystroke event to the currently active panel.
우선 'k' 키를 받는 이벤트를 만드시고요..
이 이벤트를 받으면 FakeKeystroke로 z key code와 down arrow key code를 넘기면 됩니다.
int CVICALLBACK PnaelEvent (int panel, int event, void *callbackData, int eventData1, int eventData2){ switch (event) { case EVENT_GOT_FOCUS:
break; case EVENT_LOST_FOCUS:
break;
case EVENT_KEYPRESS:
//k K
if((eventData1==107)||(eventData1==75))
{
FakeKeystroke(VAL_DOWN_ARROW_VKEY); down arrow key
FakeKeystroke(122);//z key
}
break; case EVENT_CLOSE:
break; } return 0;}
2011.12.21 11:00:03 *.21.242.85
감사합니다
안녕하세요 야리싸내입니다.
아래의 함수를 사용하시면 됩니다.
FakeKeystroke (int keyCode);
Purpose
Simulates a keystroke by posting a keystroke event to the currently active panel.
우선 'k' 키를 받는 이벤트를 만드시고요..
이 이벤트를 받으면 FakeKeystroke로 z key code와 down arrow key code를 넘기면 됩니다.
int CVICALLBACK PnaelEvent (int panel, int event, void *callbackData,
int eventData1, int eventData2)
{
switch (event)
{
case EVENT_GOT_FOCUS:
break;
case EVENT_LOST_FOCUS:
break;
case EVENT_KEYPRESS:
//k K
if((eventData1==107)||(eventData1==75))
{
FakeKeystroke(VAL_DOWN_ARROW_VKEY); down arrow key
FakeKeystroke(122);//z key
}
break;
case EVENT_CLOSE:
break;
}
return 0;
}