Showing results 1 to 3 of 3

Thread: VBA script on touch screen

  1. #1
    Join Date
    08.07.2014
    Posts
    1

    Default VBA script on touch screen

    Hi!

    I want to run a VBA script when I raise my finger from a touch screen. I thought if I set the script to run when the left mouse button is released it will work, but it seems like the tap does not work like a left mouse click. I did not find other option where I can set my script to run.
    Does anybody have any idea? I use Zenon 7.11 and Windows 8.1.

    Thank you in advance for your help.

  2. #2

    Default Re: VBA script on touch screen

    Hi Arpi,

    Thanks for your post and welcome to the forum

    Indeed, touch events are different from Click events. You can also access touch events in VBA, but zenon also offer more sophisticated touch support that does not require any coding.

    If you want to react on touch events in VBA, have a look at the events that exist at the DynPictures collection.

    Public WithEvents Scrs As DynPictures
    
    
    Private Sub Project_Active()
    Set Scrs = thisProject.DynPictures
    End Sub
    
    Private Sub Scrs_TouchEvent(pvX() As Long, pvY() As Long, pvSource() As stdole.OLE_HANDLE, PvID() As Long, pvFlags() As Long, pvMask() As Long, pvTime() As Long, pvExtraInfo() As Long, pvXContact() As Long, pvYContact() As Long)
    Debug.Print "TouchEvent"
    End Sub
    
    Private Sub Scrs_TouchManipulationCompleteEvent(ByVal lX As Long, ByVal lY As Long, ByVal lTransX As Long, ByVal lTransY As Long, ByVal fScaleFactor As Single, ByVal fRotation As Single, ByVal lContacts As Long)
    Debug.Print "TouchManipulationCompleteEvent"
    End Sub
    
    Private Sub Scrs_TouchManipulationDeltaEvent(ByVal lX As Long, ByVal lY As Long, ByVal lTransX As Long, ByVal lTransY As Long, ByVal fScaleFactor As Single, ByVal fRotation As Single, ByVal lContacts As Long)
    Debug.Print "TouchManipulationDeltaEvent"
    End Sub
    
    Private Sub Scrs_TouchManipulationStartEvent(ByVal lX As Long, ByVal lY As Long)
    Debug.Print "TouchManipulationStartEvent"
    End Sub


    In order to use these, you need to set the Multitouch parameter in the project properties - interaction section, to "Windows 7"

    Best regards,
    Mark

  3. #3
    Join Date
    30.05.2007
    Location
    Salzburg
    Posts
    880

    Default Re: VBA script on touch screen

    as this questions was also handled within a ticket (same user/customer) below the solution of the ticket:

    You must not mix Click-Events (which can be only fired by a mouse) and Touch-Interactions.

    If you want i.e. a that a Macro is executed on realase of a button then you have to use i.e. the Event called PointerUp()
    -> see help documentation at:
    Manual -> Multi-Touch -> Evaluating events
    Events that are to be evaluated via the programming interface can be defined in detail for screens. The evaluation is carried out via VSTA at screen level.

    -> in following chapter a sample code for VB.NET / C# is given:
    Manual -> Programming interfaces -> Objectmodel -> DynPictures -> DynPictures-Events -> PointerUp


Similar Threads

  1. Replies: 0
    Last Post: 16th January 2014, 20:45
  2. Context menu Command in touch panels
    By kiltrox in forum zenon Energy Edition
    Replies: 2
    Last Post: 18th April 2013, 08:52
  3. Screen Switch in VBA
    By paruvathakumar in forum VBA
    Replies: 12
    Last Post: 28th August 2012, 01:26
  4. Replies: 1
    Last Post: 17th December 2008, 09:07
  5. Installation on Touch Screen using DOM
    By tauhien in forum Editor and Runtime Setup
    Replies: 2
    Last Post: 26th September 2008, 02:56

Posting Rules

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •