trigger a key press event?

Back to topics list To post a new topic, please log in or register
avatar
62
nikolaygmt 2016.05.05 14:24
 

How can I program triggering a key press/event?

For the following use case: Normally one can zoom with the "+" and "-" keys, but I would like to zoom with "q" and "r" and my idea is when "q" is pressed to trigger pressing the "+" key. Or are there better ideas how to create this use case?

avatar
Moderator
3427
GumRai 2016.05.05 14:55 #
 
Do you know that you can click and drag the date/time axis. Right to zoom in, left to zoom out.
avatar
62
nikolaygmt 2016.05.05 14:56 #
 

I found it:


#import "user32.dll"

void keybd_event(int bVk,int bScan,int dwFlags,int dwExtraInfo);

keybd_event(187,0,0,0); //+ button

keybd_event(189,0,0,0); //- button

Keycodes: http://help.adobe.com/en_US/AS2LCR/Flash_10.0/help.html?content=00000520.html
avatar
69
Tecuciztecatl 2016.05.06 11:27 #
 
OnChartEvent() function  with CHARTEVENT_KEYDOWN is to survey the keyboard.
Back to topics list  

To add comments, please log in or register