diff --git a/src/CameraController.hx b/src/CameraController.hx index ded3867e..34347e5f 100644 --- a/src/CameraController.hx +++ b/src/CameraController.hx @@ -68,6 +68,8 @@ class CameraController extends Object { public var oob:Bool = false; public var finish:Bool = false; + var _ignoreCursor:Bool = false; + public function new(marble:Marble) { super(); this.marble = marble; @@ -88,6 +90,7 @@ class CameraController extends Object { var pointercontainer = js.Browser.document.querySelector("#pointercontainer"); pointercontainer.hidden = true; #end + _ignoreCursor = true; Window.getInstance().lockPointer((x, y) -> orbit(x, y)); #if hl Cursor.show(false); @@ -108,6 +111,10 @@ class CameraController extends Object { } public function orbit(mouseX:Float, mouseY:Float, isTouch:Bool = false) { + if (_ignoreCursor) { + _ignoreCursor = false; + return; + } var scaleFactor = 1.0; #if js scaleFactor = 1 / js.Browser.window.devicePixelRatio; diff --git a/src/gui/EnterNameDlg.hx b/src/gui/EnterNameDlg.hx index 24943065..46bebc74 100644 --- a/src/gui/EnterNameDlg.hx +++ b/src/gui/EnterNameDlg.hx @@ -65,6 +65,7 @@ class EnterNameDlg extends GuiControl { var okbutton = new GuiButton(loadButtonImages("data/ui/common/ok")); okbutton.position = new Vector(163, 182); okbutton.extent = new Vector(78, 59); + okbutton.accelerator = hxd.Key.ENTER; okbutton.pressedAction = (sender) -> { MarbleGame.canvas.popDialog(this); Settings.highscoreName = enterNameEdit.text.text; diff --git a/src/gui/ExitGameDlg.hx b/src/gui/ExitGameDlg.hx index bd9393e3..37f6448f 100644 --- a/src/gui/ExitGameDlg.hx +++ b/src/gui/ExitGameDlg.hx @@ -54,7 +54,6 @@ class ExitGameDlg extends GuiControl { noButton.extent = new Vector(83, 55); noButton.vertSizing = Bottom; noButton.horizSizing = Right; - noButton.accelerator = hxd.Key.ESCAPE; noButton.pressedAction = noFunc; var restartButton = new GuiButton(loadButtonImages("data/ui/common/restart"));