Search Unity

  1. Good news ✨ We have more Unite Now videos available for you to watch on-demand! Come check them out and ask our experts any questions!
    Dismiss Notice
  2. Ever participated in one our Game Jams? Want pointers on your project? Our Evangelists will be available on Friday to give feedback. Come share your games with us!
    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

    Joined:
    Oct 8, 2014
    Posts:
    2
    H,

    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);
    myInt++;
    status.Append ("\nmyInt: " );
    status.Append (myInt);
    break;

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

    AlexThibodeau

    Unity Technologies

    Joined:
    Jul 23, 2013
    Posts:
    309
    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

    Joined:
    Oct 8, 2014
    Posts:
    2
    I am using SamsungTV.GestureMode.Mouse.
    I am not using Joystick mode.
     
unityunity