LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Firing keydown event from software`

I would like to know how to fire a keydown or mousedown etc. event from the program itself. Without actually pressing the keys or buttons.
Something to do with dynamic event programming?
0 Kudos
Message 1 of 10
(4,220 Views)
Searching for "simulate mouse" or "simulate keyboard" should return some hits. Here and here are a couple.
 
If you only want to fire the event, you can create a dynamic event and fire it instead of the key down event.

___________________
Try to take over the world!
0 Kudos
Message 2 of 10
(4,201 Views)
An easy method using dynamic events is to create an event which has the same signature as the mouse event and key down event, then fire them from within the actual key-down and mouse events as well as from any other place in your program.  This is not as powerful as dealing with the system dlls but should allow you to do most of what you probably want to do anyway.
 
Paul
Paul Falkenstein
Coleman Technologies Inc.
CLA, CPI, AIA-Vision
Labview 4.0- 2013, RT, Vision, FPGA
0 Kudos
Message 3 of 10
(4,196 Views)
Hi Paul,
 
I've tried a few things with dynamic events but no good results, it is actually not very clear to me. The Labview manuals etc doesn't give much information either.
Do you know any sites etc. with good working examples.
 
Thanks
0 Kudos
Message 4 of 10
(4,189 Views)

Dynamic events are one of the best features added to LV 7.0 and have saved me a few times.  The idea is that you can add events which an event handeler can register for the only thing you have to do it decide on the parameters which define the event. basically you craete a user event, register for the event, pass the event to the dynamic event terimina (right click on the event structure and "show dynamic event terminal" then add the event case just as you do with a native event.  In addition you can turn on and off the dynamic events as needed.  I will post an example I did later if it would help.  Spent the time to learn dynamic events, well worth the effort.

Paul

Paul Falkenstein
Coleman Technologies Inc.
CLA, CPI, AIA-Vision
Labview 4.0- 2013, RT, Vision, FPGA
0 Kudos
Message 5 of 10
(4,177 Views)
Thanks, this is very useful. The only difference with a keyboard generated event is that there no scancode given in the keydown event. But the others are..
 
0 Kudos
Message 6 of 10
(4,174 Views)

Here is an example I had done for a numeric pad, it is very crude but shows how to generate a dynamic event to handle either a simulated keyboard or a ture keyboard event.  There is so much more to dynamic events than I showe here but you should get the idea from this 'toy' example.

 

Paul

Paul Falkenstein
Coleman Technologies Inc.
CLA, CPI, AIA-Vision
Labview 4.0- 2013, RT, Vision, FPGA
0 Kudos
Message 7 of 10
(4,167 Views)

I always forget to attach the examples.  See the attached example,

Paul

Paul Falkenstein
Coleman Technologies Inc.
CLA, CPI, AIA-Vision
Labview 4.0- 2013, RT, Vision, FPGA
0 Kudos
Message 8 of 10
(4,166 Views)
THanks this is more or less what I'm looking for, merging two events into one.. Explains a lot
0 Kudos
Message 9 of 10
(4,146 Views)
I here a working example, in which an keyboard event is fired and is acted upon in the eventstructure. Weird thing is that labview is not giving the charcode in the Keyup event.
in the Keydown event the scancode is not given. The scancode is given in the keyup event. ?!?
Message 10 of 10
(4,142 Views)