Skip to content

Commit

Permalink
Fix issues with mouse on multimonitor setups
Browse files Browse the repository at this point in the history
  • Loading branch information
ddevault committed Oct 18, 2016
1 parent 1d9c250 commit e7ca126
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 4 deletions.
Expand Up @@ -4,7 +4,6 @@
using System.Collections.Generic;
using System.Drawing;
using osu.Framework.Input.Handlers;
using osu.Framework.Threading;
using OpenTK;
using osu.Framework.Platform;
using OpenTK.Input;
Expand Down Expand Up @@ -35,7 +34,8 @@ public override void UpdateInput(bool isActive)
state = OpenTK.Input.Mouse.GetState();
var cursorState = OpenTK.Input.Mouse.GetCursorState();
wheelDiff = state.Wheel - previousState.Wheel;
position = new Vector2(cursorState.X - host.Window.Bounds.X, cursorState.Y - host.Window.Bounds.X);
var point = host.Window.PointToClient(new Point(cursorState.X, cursorState.Y));
position = new Vector2(point.X, point.Y);
previousState = state;
}

Expand Down
2 changes: 1 addition & 1 deletion osu.Framework/Graphics/UserInterface/TextBox.cs
Expand Up @@ -516,7 +516,7 @@ protected override bool OnKeyDown(InputState state, KeyDownEventArgs args)

protected override bool OnCharacterInput(char c)
{
Game.Audio.Sample.Get($@"Keyboard/key-press-{RNG.Next(1, 5)}")?.Play();
game.Audio.Sample.Get($@"Keyboard/key-press-{RNG.Next(1, 5)}")?.Play();
insertString(c.ToString());
return true;
}
Expand Down
1 change: 0 additions & 1 deletion osu.Framework/Platform/BasicGameWindow.cs
Expand Up @@ -2,7 +2,6 @@
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu-framework/master/LICENCE

using System;
using System.Drawing;
using OpenTK;

namespace osu.Framework.Platform
Expand Down

0 comments on commit e7ca126

Please sign in to comment.