Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We’re making changes to the Unity Runtime Fee pricing policy that we announced on September 12th. Access our latest thread for more information!
    Dismiss Notice
  3. Dismiss Notice

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.