本文整理汇总了C#中OpenTK.Input.MouseMoveEventArgs类的典型用法代码示例。如果您正苦于以下问题:C# MouseMoveEventArgs类的具体用法?C# MouseMoveEventArgs怎么用?C# MouseMoveEventArgs使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
MouseMoveEventArgs类属于OpenTK.Input命名空间,在下文中一共展示了MouseMoveEventArgs类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: OnMouseMove
public bool OnMouseMove(MouseMoveEventArgs e)
{
Point p = e.Position;
if(this.hover != null) {
if(this.hover.Bounds.Contains(p)) {
this.hover.OnMouseMove(p-(Size) this.hover.Bounds.Location);
return true;
}
}
foreach(OpenGLComponent oglc in this.components) {
if(oglc.Bounds.Contains(p)) {
if(this.hover != null) {
this.hover.OnMouseLeave();
}
this.hover = oglc;
this.hover.OnMouseEnter();
return true;
}
}
if(this.hover != null) {
this.hover.OnMouseLeave();
}
this.hover = null;
return false;
}
示例2: Mouse_Move
void Mouse_Move(object sender, MouseMoveEventArgs e)
{
if (Mouse[MouseButton.Left])
{
AddLine(e.X, e.Y);
}
}
示例3: OnMouseMove
private void OnMouseMove(object sender, MouseMoveEventArgs e)
{
if (e.Mouse.LeftButton == ButtonState.Pressed && _touches.Count > 0)
{
double now = DateTime.Now.Ticks / TimeSpan.TicksPerMillisecond;
float xConversion = SparrowSharpApp.Stage.Width / Size.Width;
float yConversion = SparrowSharpApp.Stage.Height / Size.Height;
Touch movedTouch = _touches[pointerId];
movedTouch.PreviousGlobalX = movedTouch.GlobalX;
movedTouch.PreviousGlobalY = movedTouch.GlobalY;
movedTouch.TimeStamp = now;
float xc = e.Mouse.X * xConversion;
float yc = e.Mouse.Y * yConversion;
if (movedTouch.GlobalX == xc && movedTouch.GlobalY == yc)
{
movedTouch.Phase = TouchPhase.Stationary;
}
else
{
movedTouch.GlobalX = xc;
movedTouch.GlobalY = yc;
movedTouch.Phase = TouchPhase.Moved;
}
if (movedTouch.Target == null || movedTouch.Target.Stage == null)
{
// target could have been removed from stage -> find new target in that case
Point updatedTouchPosition = Point.Create(movedTouch.GlobalX, movedTouch.GlobalY);
movedTouch.Target = SparrowSharpApp.Root.HitTestPoint(updatedTouchPosition);
}
}
processTouch();
}
示例4: OnMouseMove
void OnMouseMove(object sender, MouseMoveEventArgs e)
{
if (e.XDelta < 200 && e.YDelta < 200)
{
game.OnMouseMove(sender, e);
}
}
示例5: ProcessMouse
public static void ProcessMouse(int oriX,int oriY){
EventArgs evnt=null;
var pressed = false;
prevMouseState =curMouseState;
curMouseState = Mouse.GetCursorState ();
Gwen.Input.InputHandler.HoveredControl =input.m_Canvas.GetControlAt(curMouseState.X - oriX, curMouseState.Y - oriY);
foreach (var mouseCode in mouseCodes)
if (curMouseState[mouseCode]!=prevMouseState[mouseCode]){
evnt = new MouseButtonEventArgs(curMouseState.X - oriX, curMouseState.Y - oriY, mouseCode, true);//last param bugged
//evnt = new MouseButtonEventArgs (curMouseState.X, curMouseState.Y, mouseCode,true);//last param bugged
if (curMouseState [mouseCode]) {
pressed = true;
Gwen.Input.InputHandler.MouseFocus = Gwen.Input.InputHandler.HoveredControl;
OnMouseDown?.Invoke ((MouseButtonEventArgs)evnt);
} else {
OnMouseUp?.Invoke ((MouseButtonEventArgs)evnt);
}
}
Vector2 delta =MainWindow.lastPos - new Vector2(curMouseState.X, curMouseState.Y);
if (Math.Abs (delta.X) > 0 || Math.Abs (delta.Y) > 0) {
evnt = new MouseMoveEventArgs (curMouseState.X-oriX, curMouseState.Y-oriY,(int)delta.X,(int)delta.Y);
OnMouseMove?.Invoke (evnt as MouseMoveEventArgs);
}
input.ProcessMouseMessage (evnt,pressed);
MainWindow.lastPos = new Vector2 (curMouseState.X, curMouseState.Y);
}
示例6: GameWindow_MouseMove
private void GameWindow_MouseMove(object sender, MouseMoveEventArgs e)
{
if (ButtonState.Pressed == e.Mouse.LeftButton)
{
visual.OrbitCamera.Heading += 300 * e.XDelta / (float)gameWindow.Width;
visual.OrbitCamera.Tilt += 300 * e.YDelta / (float)gameWindow.Height;
}
}
示例7: MouseMove
protected override void MouseMove( object sender, MouseMoveEventArgs e )
{
base.MouseMove( sender, e );
if( selectedWidget != null && selectedWidget == widgets[tableIndex] ) {
LauncherTableWidget table = (LauncherTableWidget)widgets[tableIndex];
table.MouseMove( e.XDelta, e.YDelta );
}
}
示例8: OnMouseMove
public override void OnMouseMove (MouseMoveEventArgs evnt)
{
//if (isDragging && Selection.assets.Count==0 && tree.SelectedChildren.Any ())
// foreach (var asset in tree.SelectedChildren)
// Selection.assets.Add (asset.Content);
//canvas.NeedsRedraw = true;
}
示例9: MouseMove
public override void MouseMove(MouseMoveEventArgs e)
{
base.MouseMove(e);
if (this.IsMouseOver() && !this.ShouldPassInput && !GUIManager.IsPanelAbovePoint(new Vector2(Utilities.engine.Mouse.X, Utilities.engine.Mouse.Y), this))
{
System.Windows.Forms.Cursor.Current = System.Windows.Forms.Cursors.Hand;
}
}
示例10: mouseMoveHandler
protected virtual void mouseMoveHandler(object sender, MouseMoveEventArgs e)
{
if (this.mouseButtonDown) {
// Console.WriteLine("mouse dragged: {0},{1}",e.XDelta,e.YDelta);
this.scene.ActiveCamera.MouseDeltaOrient(e.XDelta,e.YDelta);
// this.activeModel.MouseDeltaOrient(e.XDelta,e.YDelta);
}
}
示例11: FromArgs
public static IEnumerable<GLMouseInput> FromArgs(MouseMoveEventArgs args, int windowWidth, int windowHeight)
{
int xDelta = args.X - windowWidth / 2;
int yDelta = args.Y - windowHeight / 2;
if (xDelta < 0) yield return new GLMouseInput(InputType.TurnLeft, InputState.Maintained, -xDelta);
if (xDelta > 0) yield return new GLMouseInput(InputType.TurnRight, InputState.Maintained, xDelta);
if (yDelta < 0) yield return new GLMouseInput(InputType.TurnUp, InputState.Maintained, -yDelta);
if (yDelta > 0) yield return new GLMouseInput(InputType.TurnDown, InputState.Maintained, yDelta);
}
示例12: Mouse_Move
void Mouse_Move(object sender, MouseMoveEventArgs e)
{
if (capture_mouse) {
lock (_mouseDeltas)
{
_mouseDeltas.y = e.YDelta * _mouse_speed;
_mouseDeltas.x = e.XDelta * _mouse_speed;
}
//System.Windows.Forms.Cursor.Position = new System.Drawing.Point(500,500);
}
}
示例13: Mouse_Move
void Mouse_Move(object sender, MouseMoveEventArgs e)
{
CurrentMousePosition = new Vector2(e.X / ControlWidth, e.Y / ControlHeight);
// trigger touch move events
foreach (MouseButton button in Enum.GetValues(typeof(MouseButton)))
{
var buttonId = (int)button;
if (MouseButtonCurrentlyDown[buttonId])
HandlePointerEvents(buttonId, CurrentMousePosition, PointerState.Move, PointerType.Mouse);
}
}
示例14: move
void move(MouseMoveEventArgs e)
{
var dx = e.X - lastX;
var dy = e.Y - lastY;
lastX = e.X;
lastY = e.Y;
rx -= dx*xySpeed;
ry -= dy*xySpeed;
if(ry>=89)
ry=89;
if(ry<=-89)
ry=-89;
}
示例15: OnMouseMove
protected override void OnMouseMove(MouseMoveEventArgs e)
{
switch (Settings.gameStatus)
{
case Settings.GameStatus.Startmenu:
break;
case Settings.GameStatus.Gamewindow:
Game.OnMouseMove(e);
break;
default:
break;
}
}