Virtual TouchPanels?
mpullin
Posts: 949
I'm exploring the possibility of creating a virtual device and having it function like a phantom touchpanel. For instance:
Here's the question: can I generate Button_Events on a virtual device?
For instance, if someone pushes 47 one of my real TPs, I want that to push 1 on my phantom TP, which will then cause the desired reaction from the UI Module, in this case the MAX's.
If so, how?
DEFINE_DEVICE vdvMEDIAPLAY = 35000:1:0 vdvPHANTOMTP = 35001:1:0 DEFINE_MODULE 'AMX_MAX4PLUS_UI' AMX_MAX4Plus_UI3 (vdvMEDIAPLAY,vdvPHANTOMTP,TP_BUTTONS,TP_FIELDS,nUI3_DEFAULT_ZONE,nUI3_DEF_ASPECT,nUI3_DEF_AUDIO,strIP_ADDRESS,UI3_LISTS)This would allow me to use other people's UI files without having to modify them so that the button definitions fit my interface, or having to change my interface if I need to swap modules. Also, no need to have multiple instances of the module in my code for each touchpanel I have.
Here's the question: can I generate Button_Events on a virtual device?
For instance, if someone pushes 47 one of my real TPs, I want that to push 1 on my phantom TP, which will then cause the desired reaction from the UI Module, in this case the MAX's.
If so, how?
0
Comments
I have made this method work with great success.
Use the command DO_PUSH(vdvTP,button_channel)
Example
You can also monitor sent text and page flips.
Of course you can always store the returned text in an array for later use.
Enjoy!
Thanks a lot.
EDIT: You think this would qualify as a tip or trick?
Sure, but how do we get it moved?
P>S> yes I am sucking up, looking for one of those leather jackets or even one like Chip got.
You also cannot simulate online & offline, the way a wireless panel would behave.
Fred
I've never tried it, but wouldn't DO_PUSH_TIMED and DO_RELEASE work for this? In theory, shouldn't the DO_PUSH_TIMED trigger the HOLD event, assuming that the timer for the DO_PUSH exceeds the timer for the HOLD event?
--D
Right you are Dave!
Here are other options to the DO_PUSH statement.
DO_PUSH_TIMED
Similar to DO_PUSH except this one lets you specify the timeout. DO_PUSH defaults to a 0.5s push on a channel before issuing a DO_RELEASE for you (unless another DO_PUSH is executed for the same channel). DO_PUSH_TIMED lets you control the length of time that will pass before the automatic DO_RELEASE is generated. The syntax:
Parameters:
Device - the device to PUSH.
Channel - the channel to PUSH.
Timeout - the time (in 1/10ths of seconds) that the PUSH shall remain active. If zero is specified as the timeout then the timeout is 0.5s.
If DO_PUSH_TIMED_INFINITE is specified as the timeout then the push never times out. This will allow the simulation of a HOLD.
Make sure you generate a DO_RELEASE.