Search Unity

  1. We are migrating the Unity Forums to Unity Discussions. On July 12, the Unity Forums will become read-only.

    Please, do not make any changes to your username or email addresses at during this transition time.

    It's still possible to reply to existing private message conversations during the migration, but any new replies you post will be missing after the main migration is complete. We'll do our best to migrate these messages in a follow-up step.

    On July 15, Unity Discussions will become read-only until July 18, when the new design and the migrated forum contents will go live.

    Read our full announcement for more information and let us know if you have any questions.

How to read Gesture Events (SamsungTV)

Discussion in 'Samsung Smart TV' started by Gandharv Pal, Jan 5, 2015.

  1. Gandharv Pal

    Gandharv Pal

    Oct 8, 2014

    I am trying to read Gesture Events in Samsung DTV's.
    My application is detecting one hand but not updating the cursor or x and y axes. I've read the Unity's manual for Samsung TV Input and Gesture One Hand Events have been mentioned there as mouse events. I'm trying to read them just as we read mouse events. But still, no success. Kindly assist!

    The code snippet:
    case InputMode.Gesture:
    inputRect.width = 1.0f;
    inputRect.height = 1.0f;
    inputRect.x = (Input.mousePosition.x) / Screen.width;
    inputRect.y = (Screen.height - Input.mousePosition.y) / Screen.height;
    status.Append ("x: ");
    status.Append (Input.mousePosition.x);
    status.Append ("\ny: ");
    status.Append (Input.mousePosition.y);
    status.Append ("\n");
    status.Append ("Camera Connected: ");
    status.Append (SamsungTV.gestureWorking);
    status.Append ("\nmyInt: " );
    status.Append (myInt);

    Here in this code, SamsungTV.gestureWorking is true. But x and y remain 0.
  2. AlexThibodeau


    Unity Technologies

    Jul 23, 2013
    Hey there,
    Here's some documentation:
    • SamsungTV.gestureMode can be set to one of the following:
      • SamsungTV.GestureMode.Off
        • Camera data is ignored (default)
      • SamsungTV.GestureMode.Mouse
        • One hand controls a mouse pointer. Grabbing clicks mouse 0.
      • SamsungTV.GestureMode.Joystick
        • Two hands control two joystick axes.
          • Joystick 2 Axis 2: hand 1 x axis
          • Joystick 2 Axis 3: hand 1 y axis
          • Joystick 2 Axis 4: hand 2 x axis
          • Joystick 2 Axis 5: hand 2 y axis
        • Grabbing activates the following joystick buttons:
          • Joystick 2 Button 0: hand 1 grab
          • Joystick 2 Button 1: hand 2 grab
    • SamsungTV.gestureWorking
      • Returns true if the camera currently sees at least 1 hand.
    Which gesturemode are you currently in? If you're in Joystick mode then mouse position won't return anything.
  3. Gandharv Pal

    Gandharv Pal

    Oct 8, 2014
    I am using SamsungTV.GestureMode.Mouse.
    I am not using Joystick mode.