本文整理汇总了C#中Mouse类的典型用法代码示例。如果您正苦于以下问题:C# Mouse类的具体用法?C# Mouse怎么用?C# Mouse使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Mouse类属于命名空间,在下文中一共展示了Mouse类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: InvokeContextMenu
public Menu InvokeContextMenu(Condition condition)
{
var mouse = new Mouse();
mouse.RightClick(this);
return new Window(AutomationElement.RootElement, "Desktop").Find<Menu>(condition);
}
示例2: InputCommands
public InputCommands(Keyboard keyboard, Mouse mouse, Touch touch, GamePad gamePad)
{
this.keyboard = keyboard;
this.mouse = mouse;
this.touch = touch;
this.gamePad = gamePad;
}
示例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;
}
}
示例4: EditorOpenTkViewport
public EditorOpenTkViewport(Window window, Mouse mouse)
{
Window = window;
this.mouse = mouse;
screenSpace = new Camera2DScreenSpace(window);
Settings.Current.LimitFramerate = 60;
}
示例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();
}
示例6: InputManager
internal InputManager()
{
#if !WINDOWS_PHONE
Players = new PlayerInputCollection();
Mouse = new Mouse();
#endif
}
示例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());
}
示例8: Menu
public Menu(Screen screen, Mouse mouse)
{
_screen = screen;
_mouse = mouse;
_subjectBarStatus = MenuState.MENU_CLOSED;
_objectBarStatus = MenuState.MENU_CLOSED;
}
示例9: HandleWithMouse
public void HandleWithMouse(Mouse mouse)
{
Position = mouse.Position;
if (mouse.GetButtonState(Button) == State &&
ScreenSpace.Current.Viewport.Contains(mouse.Position))
Invoke();
}
示例10: HandleWithMouse
public void HandleWithMouse(Mouse mouse)
{
if (Position == mouse.Position)
return;
Position = mouse.Position;
if (ScreenSpace.Current.Viewport.Contains(mouse.Position))
Invoke();
}
示例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> ();
}
示例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;
}
示例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();
}
示例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;
}
示例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();
}