Announcement

Collapse
No announcement yet.

Various - Touch Regions; Graphic Composer

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Various - Touch Regions; Graphic Composer

    Just starting with gen4-ulcd-70dct in a serial environment. The serial manual refers to 'Graphic Composer software'. Where is it? I will want to display images on the screen and it looks like I need this software.
    Another question - I need to detect touch from several positions on the screen (several buttons). There is a command there to set a 'touch detect region' and 'touch_get'. Can I set several regions at the same time and how will I know from which region (or from which button) is the touch event?

  • #2
    Hi,

    The serial manual refers to 'Graphic Composer software'. Where is it?
    The Graphic Composer (GC.EXE) is located in the Workshop4 directory DEP folder.
    C:\Program Files (x86)\4D Labs\4D Workshop 4 IDE\DEP

    Can I set several regions at the same time
    You could only set one active region on the screen

    I need to detect touch from several positions on the screen
    You could get the status of the touch then check for the x and y coordinate if it is within the area of the button. You could do this as follows:
    - Touch Set (mode = 0) -> Enable touch
    - Touch Get (mode = 0) -> Get the status (e.g. no touch, touch pressed, released, or moving)
    - Touch Get (mode = 1) -> Get the x-coordinate of the touch area
    - Touch Get (mode = 2) -> Get the y-coordinate of the touch area

    I hope it helps.

    Best Regards,
    Kevin

    Comment


    • #3
      Hi Kevin,
      Thanks for the GC.exe, found it. The touch problem is, however, not clear. I have say 4 buttons on the screen and the user can press any one of them at any time - and I have to detect it.
      I take it there is not 'interrupt' which would alert me that a button was pressed? So is this how it's done:
      - Touch Set (mode = 0) -> Enable touch
      | do
      | do
      | - Touch Get (mode = 0) -> Get the status (e.g. no touch, touch pressed, released, or moving)
      | loop until touch detected then
      | - Touch Get (mode = 1) -> Get the x-coordinate of the touch area
      | - Touch Get (mode = 2) -> Get the y-coordinate of the touch area
      | loop forever

      That seems very inefficient way.

      Regards,
      Mike



      Comment


      • #4
        Hi Mike,

        Thanks for your reply. Yes, that is correct. You could do it this way

        - Touch Set (mode = 0) -> Enable touch
        repeat
        - Touch Get (mode=0)
        if(1)//pressed
        Touch Get (mode=1) //get x-coordinate
        Touch Get (mode=2) //get y-coordinate
        endif
        forever


        Or if you are checking for the buttons positions:

        - Touch Set (mode = 0) -> Enable touch
        repeat
        - Touch Get (mode=0)
        if(1)//pressed
        if (Touch Get (mode=1) == (button x-pos) && Touch Get (mode=2) == (button y-pos) )
        endif
        forever

        Best Regards,
        Kevin

        Comment

        Working...
        X