• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C# Mouse类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C#中Mouse的典型用法代码示例。如果您正苦于以下问题:C# Mouse类的具体用法?C# Mouse怎么用?C# Mouse使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



Mouse类属于命名空间,在下文中一共展示了Mouse类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。

示例1: InvokeContextMenu

        public Menu InvokeContextMenu(Condition condition)
        {
            var mouse = new Mouse();
            mouse.RightClick(this);

            return new Window(AutomationElement.RootElement, "Desktop").Find<Menu>(condition);
        }
开发者ID:pako4u2k,项目名称:wipflash,代码行数:7,代码来源:AutomationElementWrapper.cs


示例2: InputCommands

 public InputCommands(Keyboard keyboard, Mouse mouse, Touch touch, GamePad gamePad)
 {
     this.keyboard = keyboard;
     this.mouse = mouse;
     this.touch = touch;
     this.gamePad = gamePad;
 }
开发者ID:hillwhite,项目名称:DeltaEngine,代码行数:7,代码来源:InputCommands.cs


示例3: GwenInput

        public GwenInput(InputManager inputManager)
        {
            this.inputManager = inputManager;

            canvas = null;
            mouseX = 0;
            mouseY = 0;
            m_AltGr = false;

            mouse = inputManager.Mouse;
            if (mouse != null)
            {
                mouse.MouseMove += ProcessMouseMove;
                mouse.MouseDrag += ProcessMouseDrag;
                mouse.MouseButtonPress += ProcessMouseButtonPressed;
                mouse.MouseButtonRelease += ProcessMouseButtonReleased;
                mouse.MouseWheelMove += ProcessMouseWheel;
            }

            keyboard = inputManager.Keyboard;
            if (keyboard != null)
            {
                keyboard.KeyPress += ProcessKeyDown;
                keyboard.KeyRelease += ProcessKeyUp;
                keyboard.KeyText += ProcessText;
            }
        }
开发者ID:FloodProject,项目名称:flood,代码行数:27,代码来源:GUIRenderer.cs


示例4: EditorOpenTkViewport

 public EditorOpenTkViewport(Window window, Mouse mouse)
 {
     Window = window;
     this.mouse = mouse;
     screenSpace = new Camera2DScreenSpace(window);
     Settings.Current.LimitFramerate = 60;
 }
开发者ID:remy22,项目名称:DeltaEngine,代码行数:7,代码来源:EditorOpenTkViewport.cs


示例5: Main

    public static int Main(string[] args)
    {
        Q_INIT_RESOURCE("mice");
        new QApplication(args);

        scene = new QGraphicsScene();
        scene.SetSceneRect(-300, -300, 600, 600);
        scene.itemIndexMethod = QGraphicsScene.ItemIndexMethod.NoIndex;

        for (int i = 0; i < MouseCount; ++i) {
            Mouse mouse = new Mouse();
            mouse.SetPos(Math.Sin((i * 6.28) / MouseCount) * 200,
                          Math.Cos((i * 6.28) / MouseCount) * 200);
            scene.AddItem(mouse);
        }

        QGraphicsView view = new QGraphicsView(scene);
        view.SetRenderHint(QPainter.RenderHint.Antialiasing);
        view.BackgroundBrush = new QBrush(new QPixmap(":/images/cheese.jpg"));
        view.CacheMode = (int) QGraphicsView.CacheModeFlag.CacheBackground;
        view.dragMode = QGraphicsView.DragMode.ScrollHandDrag;
        view.WindowTitle = QT_TRANSLATE_NOOP("QGraphicsView", "Colliding Mice");
        view.Resize(400, 300);
        view.Show();

        return QApplication.Exec();
    }
开发者ID:KDE,项目名称:qyoto,代码行数:27,代码来源:main.cs


示例6: InputManager

 internal InputManager()
 {
     #if !WINDOWS_PHONE
     Players = new PlayerInputCollection();
     Mouse = new Mouse();
     #endif
 }
开发者ID:Jemeyr,项目名称:Halloween,代码行数:7,代码来源:InputManager.cs


示例7: OnStart

    public override void OnStart()
    {
        base.OnStart();

        sound = gameObject.RequireComponent<CSound>();
        doorButtonMesh = gameObject.RequireComponent<CMeshRenderer>();

        if (doorName != null && doorName.Length > 0)
        {
            door = GameObject.GetGameObjectByName(doorName);
            if (requiresSurveillancePlayer)
                doorButtonMesh.GetMaterial().SetColor(SharpMocha.YELLOW);
            else
                doorButtonMesh.GetMaterial().SetColor(SharpMocha.CORNFLOWER_BLUE);
        }
        else
        {
            isButtonRed = true; // it is a default locked button
        }
        doorButtonColor = doorButtonMesh.GetMaterial().GetColor();

        playerMouse = GetScript<Mouse>(Common.GetStealthPlayerMouse() );
        player = Common.GetStealthPlayer();
        playerScript = Common.GetStealthPlayerScript();
        ocuConsole = GetScript<OcuConsoleScreen>(Common.GetSurveillancePlayerConsoleScreen());
    }
开发者ID:Reticulatas,项目名称:MochaEngineFinal,代码行数:26,代码来源:DoorButton.cs


示例8: Menu

 public Menu(Screen screen, Mouse mouse)
 {
     _screen = screen;
     _mouse = mouse;
     _subjectBarStatus = MenuState.MENU_CLOSED;
     _objectBarStatus = MenuState.MENU_CLOSED;
 }
开发者ID:scemino,项目名称:nscumm,代码行数:7,代码来源:Menu.cs


示例9: HandleWithMouse

		public void HandleWithMouse(Mouse mouse)
		{
			Position = mouse.Position;
			if (mouse.GetButtonState(Button) == State &&
				ScreenSpace.Current.Viewport.Contains(mouse.Position))
				Invoke();
		}
开发者ID:whztt07,项目名称:DeltaEngine,代码行数:7,代码来源:MouseButtonTrigger.cs


示例10: HandleWithMouse

		public void HandleWithMouse(Mouse mouse)
		{
			if (Position == mouse.Position)
				return;
			Position = mouse.Position;
			if (ScreenSpace.Current.Viewport.Contains(mouse.Position))
				Invoke();
		}
开发者ID:whztt07,项目名称:DeltaEngine,代码行数:8,代码来源:MouseMovementTrigger.cs


示例11: Start

	// Use this for initialization
	public void Start () {
		//Debug.Log ("START FROM ABILITY");
		caster = this.transform.parent.gameObject;
		//Debug.Log (caster);
		mouseS = GameObject.Find("Main Camera").GetComponent<Mouse> ();
		aMan = GameObject.Find("AbilityManager").GetComponent<AbilityManager> ();
		guiScript = GameObject.Find ("SpawnGUI").GetComponent<UserInterfaceGUI> ();
	}
开发者ID:Bjeck,项目名称:BM-RTS-game,代码行数:9,代码来源:Ability.cs


示例12: SelectedEventArgs

 public SelectedEventArgs(int position, Mouse mouse, int count, double x,double y,ChessPiece chess)
 {
     this.Position = position;
     this.Mouse = mouse;
     this.Count = count;
     this.Chess = chess;
     this.X = x;
     this.Y = y;
 }
开发者ID:wangjianglin,项目名称:chess,代码行数:9,代码来源:SelectedEvent.cs


示例13: HandleWithMouse

		public void HandleWithMouse(Mouse mouse)
		{
			if (Position == mouse.Position)
				return;
			var isButton = mouse.GetButtonState(Button) == State;
			Position = mouse.Position;
			if (isButton && ScreenSpace.Current.Viewport.Contains(mouse.Position))
				Invoke();
		}
开发者ID:whztt07,项目名称:DeltaEngine,代码行数:9,代码来源:MousePositionTrigger.cs


示例14: Initiliase

        public bool Initiliase(IntPtr windowHandle)
        {
            this.input = MOIS.InputManager.CreateInputSystem((uint)windowHandle.ToInt32());

            //Create all devices (We only catch joystick exceptions here, as, most people have Key/Mouse)
            this.keyboard = (Keyboard)input.CreateInputObject(MOIS.Type.OISKeyboard, true);
            this.mouse = (Mouse)input.CreateInputObject(MOIS.Type.OISMouse, true);
            return true;
        }
开发者ID:andyhebear,项目名称:glueeengine,代码行数:9,代码来源:InputManager.cs


示例15: HandleWithMouse

		public void HandleWithMouse(Mouse mouse)
		{
			bool wasJustStartedPressing = lastState == State.Pressing;
			State currentState = mouse.GetButtonState(Button);
			var isNowReleased = currentState == State.Releasing;
			lastState = currentState;
			if (isNowReleased && wasJustStartedPressing)
				Invoke();
		}
开发者ID:whztt07,项目名称:DeltaEngine,代码行数:9,代码来源:MouseTapTrigger.cs


示例16: GameCore

        public GameCore()
        {
            _renderEngine = new RenderEngine();
            _input = new DirectInput();
            _keyboard = new Keyboard(_input);
            _mouse = new Mouse(_input);

            Initialize();
        }
开发者ID:pandadead,项目名称:formulaSharp,代码行数:9,代码来源:GameCore.cs


示例17: MessageBoxScreen

        public MessageBoxScreen(string message, Texture2D mouseText)
        {
            IsPopup = true;

            TransitionOnTime = TimeSpan.FromSeconds(0.2);
            TransitionOffTime = TimeSpan.FromSeconds(0.2);

            mouse = new Mouse(mouseText);
        }
开发者ID:DanFootitt,项目名称:GamesProgramming,代码行数:9,代码来源:MessageBoxScreen.cs


示例18: AddMouse

 public bool AddMouse(Mouse m)
 {
     if (mice.Contains(m)) {
         return false;
     } else {
         mice.Add(m);
         return true;
     }
 }
开发者ID:vodkatad,项目名称:iMouse,代码行数:9,代码来源:Cage.cs


示例19: DoStartup

        static void DoStartup()
        {
            ParamList pl = new ParamList();
            Form1 form = new Form1();
            form.Show();
            pl.Insert("WINDOW", form.Handle.ToString());

            //Default mode is foreground exclusive..but, we want to show mouse - so nonexclusive
            pl.Insert("w32_mouse", "DISCL_FOREGROUND");
            pl.Insert("w32_mouse", "DISCL_NONEXCLUSIVE");

            //This never returns null.. it will raise an exception on errors
            g_InputManager = InputManager.CreateInputSystem(pl);

            uint v = InputManager.VersionNumber;
            Console.WriteLine("OIS Version: " + (v >> 16) + "." + ((v >> 8) & 0x000000FF) + "." + (v & 0x000000FF)
                + "\n\tRelease Name: " //+ InputManager.VersionName
                + "\n\tPlatform: " + g_InputManager.InputSystemName()
                + "\n\tNumber of Mice: " + g_InputManager.GetNumberOfDevices(MOIS.Type.OISMouse)
                + "\n\tNumber of Keyboards: " + g_InputManager.GetNumberOfDevices(MOIS.Type.OISKeyboard)
                + "\n\tNumber of Joys/Pads = " + g_InputManager.GetNumberOfDevices(MOIS.Type.OISJoyStick));

            //List all devices
            DeviceList list = g_InputManager.ListFreeDevices();
            foreach (KeyValuePair<MOIS.Type, string> pair in list)
                Console.WriteLine("\n\tDevice: " + g_DeviceType[(int)pair.Key] + " Vendor: " + pair.Value);

            g_kb = (Keyboard)g_InputManager.CreateInputObject(MOIS.Type.OISKeyboard, true);
            g_kb.KeyPressed += new KeyListener.KeyPressedHandler(KeyPressed);
            g_kb.KeyReleased += new KeyListener.KeyReleasedHandler(KeyReleased);

            g_m = (Mouse)g_InputManager.CreateInputObject(MOIS.Type.OISMouse, true);
            g_m.MouseMoved += new MouseListener.MouseMovedHandler(MouseMoved);
            g_m.MousePressed += new MouseListener.MousePressedHandler(MousePressed);
            g_m.MouseReleased += new MouseListener.MouseReleasedHandler(MouseReleased);

            MouseState_NativePtr ms = g_m.MouseState;
            ms.width = form.Width;
            ms.height = form.Height;

            //This demo only uses at max 4 joys
            int numSticks = g_InputManager.GetNumberOfDevices(MOIS.Type.OISJoyStick);
            if (numSticks > 4) numSticks = 4;

            g_joys = new JoyStick[numSticks];

            for (int i = 0; i < numSticks; ++i)
            {
                g_joys[i] = (JoyStick)g_InputManager.CreateInputObject(MOIS.Type.OISJoyStick, true);
                g_joys[i].AxisMoved += new JoyStickListener.AxisMovedHandler(AxisMoved);
                g_joys[i].ButtonPressed += new JoyStickListener.ButtonPressedHandler(JoyButtonPressed);
                g_joys[i].ButtonReleased += new JoyStickListener.ButtonReleasedHandler(JoyButtonReleased);
                g_joys[i].PovMoved += new JoyStickListener.PovMovedHandler(PovMoved);
                g_joys[i].Vector3Moved += new JoyStickListener.Vector3MovedHandler(Vector3Moved);
            }
        }
开发者ID:andyhebear,项目名称:extramegablob,代码行数:56,代码来源:Program.cs


示例20: HandleWithMouse

		public void HandleWithMouse(Mouse mouse)
		{
			int currentScrollValueDifference = mouse.ScrollWheelValue - LastScrollWheelValue;
			LastScrollWheelValue = mouse.ScrollWheelValue;
			if(!ScreenSpace.Current.Viewport.Contains(mouse.Position))
				return;
			ZoomAmount = currentScrollValueDifference * 0.1f;
			if (ZoomAmount != 0)
				Invoke();
		}
开发者ID:whztt07,项目名称:DeltaEngine,代码行数:10,代码来源:MouseZoomTrigger.cs



注:本文中的Mouse类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# MouseAxis类代码示例发布时间:2022-05-24
下一篇:
C# Motion类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap