コード例 #1
0
ファイル: XApi.cs プロジェクト: bostich83/axiom
 extern public static ErrorCodes XGrabPointer(
     IntPtr display,
     IntPtr grab_window,
     bool owner_events, int event_mask,
     GrabMode pointer_mode,
     GrabMode keyboard_mode,
     IntPtr confine_to,
     IntPtr cursor,
     int time
     );
コード例 #2
0
    /// <summary>
    /// Returns a cursor. Sets the _mode. Sets the _activeGraSquare (if there is one).
    /// </summary>
    /// <param name="location">The point to check. (0, 0) is upper left of the form</param>
    /// <returns>An approbiate Cursor or the default Cursor (the cached cursor of the Form)</returns>
    private Cursor checkForActiveRegionChangeCursor(Point location)
    {
        Console.WriteLine("checkForActiveRegionChangeCursor() " + location);

        //over Grabsqares?
        GrabSquare gs = null;
        bool       isInsideGrabSquare = false;

        for (int i = 0; i < _grabSquares.Count; i++)
        {
            gs = _grabSquares[i];
            isInsideGrabSquare = gs.isInside(location);
            if (isInsideGrabSquare)
            {
                break;
            }
        }

        if (isInsideGrabSquare)
        {
            //change forms cursor
            _activeGrabSquare = gs;
            _mouseOverMode    = GrabMode.DRAG;
            return(_activeGrabSquare._cursor);
        }
        //over Rectangle himself?
        if (_rectangle.Contains(location))
        {
            _activeGrabSquare = null;
            _lastMovePosition = location;
            _mouseOverMode    = GrabMode.MOVE;
            return(_insideCursor);
        }
        else
        {
            _activeGrabSquare = null;
            _mouseOverMode    = GrabMode.NONE;
            return(_defaultCursor);
        }
    }
コード例 #3
0
    // Use this for initialization
    void Start()
    {
        block_prefab = new List <GameObject>();
        block_prefab.Add(Resources.Load("BookShelfBlock", typeof(GameObject)) as GameObject);
        block_prefab.Add(Resources.Load("DirtBlock", typeof(GameObject)) as GameObject);
        block_prefab.Add(Resources.Load("GrassBlock", typeof(GameObject)) as GameObject);
        block_prefab.Add(Resources.Load("WoolBlock", typeof(GameObject)) as GameObject);
        block_prefab.Add(Resources.Load("ChestBlock", typeof(GameObject)) as GameObject);
        block_prefab.Add(Resources.Load("BrickBlock", typeof(GameObject)) as GameObject);
        block_prefab.Add(Resources.Load("HayBlock", typeof(GameObject)) as GameObject);
        block_prefab.Add(Resources.Load("PumpkinBlock", typeof(GameObject)) as GameObject);
        block_prefab.Add(Resources.Load("TntBlock", typeof(GameObject)) as GameObject);

        block_panel.SetActive(false);
        geometry_panel.SetActive(false);
        toggle_panel.SetActive(false);

        grabMode = GrabMode.Empty;

        /*blockToggle = null;
         *
         * blocks = new List<GameObject>();
         */
    }
コード例 #4
0
ファイル: Functions.cs プロジェクト: noggs/opentk
 public extern static int XGrabKeyboard(IntPtr display, IntPtr window, bool owner_events,
                                        GrabMode pointer_mode, GrabMode keyboard_mode, IntPtr timestamp);
コード例 #5
0
ファイル: API.cs プロジェクト: WolfgangSt/axiom
 extern internal static ErrorCodes GrabKeyboard(Display display, IntPtr grab_window,
     bool owner_events, GrabMode pointer_mode, GrabMode keyboard_mode, int time);
コード例 #6
0
ファイル: Functions.cs プロジェクト: Zeludon/FEZ
 public static int XGrabButton(IntPtr display, int button, uint modifiers, IntPtr grab_window, bool owner_events, EventMask event_mask, GrabMode pointer_mode, GrabMode keyboard_mode, IntPtr confine_to, IntPtr cursor);
コード例 #7
0
ファイル: Functions.cs プロジェクト: SnowmanTackler/OpenTK
 public extern static int XGrabKeyboard(IntPtr display, IntPtr window, bool owner_events,
     GrabMode pointer_mode, GrabMode keyboard_mode, IntPtr timestamp);
コード例 #8
0
ファイル: XplatUIX11.cs プロジェクト: nlhepler/mono
		internal extern static int XGrabPointer(IntPtr display, IntPtr window, bool owner_events, EventMask event_mask, GrabMode pointer_mode, GrabMode keyboard_mode, IntPtr confine_to, IntPtr cursor, IntPtr timestamp);
コード例 #9
0
 public void onMouseDown(MouseEventArgs e)
 {
     _lastMovePosition = e.Location; //initialize for move
     _mode             = _mouseOverMode;
 }
コード例 #10
0
 public void SetGrabImageMode(GrabMode mode)
 {
 }
コード例 #11
0
ファイル: Button.cs プロジェクト: MarcusWichelmann/X11.Net
 public static extern Status XGrabKey(IntPtr display, KeyCode keycode, KeyButtonMask modifiers, Window grab_window,
                                      bool owner_events, GrabMode pointer_mode, GrabMode keyboard_mode);
コード例 #12
0
ファイル: XApi.cs プロジェクト: WolfgangSt/axiom
 extern public static ErrorCodes XGrabKeyboard(IntPtr display, IntPtr grab_window,
     bool owner_events, GrabMode pointer_mode, GrabMode keyboard_mode, int time);
コード例 #13
0
ファイル: Button.cs プロジェクト: MarcusWichelmann/X11.Net
 public static extern Status XGrabPointer(IntPtr display, Window grab_window, bool owner_events, EventMask event_mask,
                                          GrabMode pointer_mode, GrabMode keyboard_mode, Window confine_to, Cursor cursor, ulong time);
コード例 #14
0
ファイル: Button.cs プロジェクト: MarcusWichelmann/X11.Net
 public static extern Status XGrabButton(IntPtr display, Button button, KeyButtonMask modifiers, Window grab_window,
                                         bool owner_events, EventMask event_mask, GrabMode pointer_mode, GrabMode keyboard_mode, Window confine_to, FontCursor cursor);
コード例 #15
0
ファイル: lib.cs プロジェクト: RoseLeBlood/libral
 extern public static int XGrabKeyboard(IntPtr display, IntPtr grab_window,
                                        bool owner_events, GrabMode pointer_mode, GrabMode keyboard_mode, int time);
コード例 #16
0
    void Update()
    {
        Transform  camera = Camera.main.transform;
        Ray        ray    = new Ray(camera.position, Vector3.Normalize(camera.rotation * Vector3.forward));
        RaycastHit hit;

        mount_panel.text = setMountPanel();

        if (cubeCanvas != null && geometryTargetObj != null)
        {
            cubeCanvas.transform.rotation = Quaternion.identity;
            cubeCanvas.transform.position = geometryTargetObj.transform.position;
            cubeCanvas.transform.Translate(0, 0, -0.05f);
        }

        if (left_hand.isActiveAndEnabled && right_hand.isActiveAndEnabled)
        {
            if (left_hand.GetLeapHand().GrabStrength > 0.99 && right_hand.GetLeapHand().GrabStrength > 0.99)
            {
                grabMode = GrabMode.Both;
            }
            else if (left_hand.GetLeapHand().GrabStrength > 0.99)
            {
                grabMode = GrabMode.LeftOnly;
            }
            else if (right_hand.GetLeapHand().GrabStrength > 0.99)
            {
                grabMode = GrabMode.RightOnly;
            }
            else
            {
                grabMode = GrabMode.Empty;
            }
        }

        switch (grabMode)
        {
        case GrabMode.Empty:
            if (Physics.Raycast(ray, out hit))            // Hit
            {
                if (hitObject == hit.collider.gameObject) // 같은 블럭
                {
                    if (grabMode == GrabMode.Empty)
                    {
                        hitObject.transform.localScale = new Vector3(1f, 1f, 1f);
                    }

                    if (!cubeAlphaObj.activeSelf)
                    {
                        countdown = timeToSelect;
                        cubeAlphaObj.SetActive(true);
                    }
                    else
                    {
                        countdown -= Time.deltaTime;
                        if (countdown < 0.0f)
                        {
                            cubeCanvas.SetActive(true);
                            countdown = timeToSelect;
                        }
                    }
                }
                else if (hitObject != null)     // 다른 블럭
                {
                    if (blockToggle.isOn)
                    {
                        //nothing
                    }
                    else
                    {
                        cubeAlphaObj.SetActive(false);
                        cubeCanvas.SetActive(false);
                        cubeAlphaObj = null;
                        cubeCanvas   = null;
                        blockToggle  = null;
                        hitObject    = hit.collider.gameObject;
                        cubeAlphaObj = hitObject.transform.GetChild(6).gameObject;
                        cubeCanvas   = hitObject.transform.GetChild(7).gameObject;
                        blockToggle  = cubeCanvas.transform.GetChild(0).GetChild(0).GetComponent <Toggle>();
                    }
                }
                else     // null 블럭
                {
                    hitObject    = hit.collider.gameObject;
                    cubeAlphaObj = hitObject.transform.GetChild(6).gameObject;
                    cubeCanvas   = hitObject.transform.GetChild(7).gameObject;
                    blockToggle  = cubeCanvas.transform.GetChild(0).GetChild(0).GetComponent <Toggle>();
                }
            }
            else     // no Hit
            {
                hitObject.transform.localScale = new Vector3(1f, 1f, 1f);
                if (hitObject != null)     // previous hit block exist
                {
                    if (blockToggle.isOn)
                    {
                        //nothing
                    }
                    else
                    {
                        //hitObject = null, effect = false&null
                        hitObject = null;
                        cubeAlphaObj.SetActive(false);
                        cubeCanvas.SetActive(false);
                        cubeAlphaObj = null;
                        cubeCanvas   = null;
                    }
                }
                else
                {
                }
            }
            break;

        case GrabMode.LeftOnly:
            Debug.Log("left");
            if (Vector3.Distance(hitObject.gameObject.transform.position, UnityVectorExtension.ToVector3(left_hand.GetLeapHand().Fingers[0].TipPosition)) < 0.15f && !blockToggle.isOn)
            {
                hitObject.transform.localScale = new Vector3(0.8f, 0.8f, 0.8f);
                Vector3 newPosition = UnityVectorExtension.ToVector3(left_hand.GetLeapHand().Fingers[0].TipPosition);

                hitObject.transform.position = new Vector3(truncate(newPosition.x), truncate(newPosition.y), truncate(newPosition.z));
            }
            break;

        case GrabMode.RightOnly:
            Debug.Log("right");
            if (Vector3.Distance(hitObject.gameObject.transform.position, UnityVectorExtension.ToVector3(right_hand.GetLeapHand().Fingers[0].TipPosition)) < 0.15f && !blockToggle.isOn)
            {
                hitObject.transform.localScale = new Vector3(0.8f, 0.8f, 0.8f);
                Vector3 newPosition = UnityVectorExtension.ToVector3(right_hand.GetLeapHand().Fingers[0].TipPosition);

                hitObject.transform.position = new Vector3(truncate(newPosition.x), truncate(newPosition.y), truncate(newPosition.z));
            }
            break;

        case GrabMode.Both:
            if (Vector3.Dot(UnityVectorExtension.ToVector3(left_hand.GetLeapHand().PalmNormal), Vector3.up) > 0 && Vector3.Dot(UnityVectorExtension.ToVector3(right_hand.GetLeapHand().PalmNormal), Vector3.up) > 0)
            {
                block_panel.SetActive(true);
            }
            //float palm_distance = Vector3.Distance(UnityVectorExtension.ToVector3(left_hand.GetLeapHand().PalmPosition), UnityVectorExtension.ToVector3(right_hand.GetLeapHand().PalmPosition));
            //hitObject.transform.localScale = new Vector3(truncate(palm_distance), truncate(palm_distance), truncate(palm_distance));
            break;
        }
    }
コード例 #17
0
ファイル: Functions.cs プロジェクト: SnowmanTackler/OpenTK
 public extern static int XGrabButton(IntPtr display,
     int button, uint modifiers, Window grab_window,
     Bool owner_events, EventMask event_mask,
     GrabMode pointer_mode, GrabMode keyboard_mode,
     Window confine_to, Cursor cursor);
コード例 #18
0
ファイル: API.cs プロジェクト: tevfikoguz/AI4CAD-3D
 extern internal static ErrorCodes GrabKeyboard(Display display, IntPtr grab_window,
                                                bool owner_events, GrabMode pointer_mode, GrabMode keyboard_mode, int time);
コード例 #19
0
ファイル: Functions.cs プロジェクト: conankzhang/fez
 public static int XGrabButton(IntPtr display, int button, uint modifiers, IntPtr grab_window, bool owner_events, EventMask event_mask, GrabMode pointer_mode, GrabMode keyboard_mode, IntPtr confine_to, IntPtr cursor);
コード例 #20
0
 public void onMouseUp(MouseEventArgs e)
 {
     _mode  = GrabMode.NONE;
     _color = doNothingColor;
     _parent.needRepaint();
 }
コード例 #21
0
 public void SetGrabImageMode(GrabMode mode)
 {
 }
コード例 #22
0
ファイル: Functions.cs プロジェクト: SnowmanTackler/OpenTK
 public extern static int XGrabKey(IntPtr display, int keycode, uint modifiers,
     Window grab_window, bool owner_events, GrabMode pointer_mode, GrabMode keyboard_mode);
コード例 #23
0
ファイル: Sdl.cs プロジェクト: slackstone/tuxjunior
 public static extern GrabMode WM_GrabInput(GrabMode mode);
コード例 #24
0
ファイル: XplatUIX11.cs プロジェクト: nlhepler/mono
		internal static int XGrabPointer(IntPtr display, IntPtr window, bool owner_events, EventMask event_mask, GrabMode pointer_mode, GrabMode keyboard_mode, IntPtr confine_to, IntPtr cursor, IntPtr timestamp)
		{
			DebugHelper.TraceWriteLine ("XGrabPointer");
			return _XGrabPointer(display, window, owner_events, event_mask, pointer_mode, keyboard_mode, confine_to, cursor, timestamp);
		}
コード例 #25
0
ファイル: Sdl.cs プロジェクト: BackupTheBerlios/supertux-svn
 public static extern GrabMode WM_GrabInput(GrabMode mode);
コード例 #26
0
ファイル: API.cs プロジェクト: WolfgangSt/axiom
 extern internal static ErrorCodes GrabPointer(Display display, IntPtr grab_window,
     bool owner_events, int event_mask, GrabMode pointer_mode, GrabMode keyboard_mode,
     IntPtr confine_to, IntPtr cursor, int time);
コード例 #27
0
ファイル: Functions.cs プロジェクト: noggs/opentk
 public extern static int XGrabButton(IntPtr display,
                                      int button, uint modifiers, Window grab_window,
                                      Bool owner_events, EventMask event_mask,
                                      GrabMode pointer_mode, GrabMode keyboard_mode,
                                      Window confine_to, Cursor cursor);
コード例 #28
0
ファイル: Functions.cs プロジェクト: luislasonbra/PixelFarm
 public extern static int XGrabPointer(IntPtr display, IntPtr window, bool owner_events, EventMask event_mask, GrabMode pointer_mode, GrabMode keyboard_mode, IntPtr confine_to, IntPtr cursor, IntPtr timestamp);
コード例 #29
0
ファイル: Functions.cs プロジェクト: noggs/opentk
 public extern static int XGrabKey(IntPtr display, int keycode, uint modifiers,
                                   Window grab_window, bool owner_events, GrabMode pointer_mode, GrabMode keyboard_mode);