From 0ab45e4c4c5bfebd97a44264c1cd47cf0b6709ba Mon Sep 17 00:00:00 2001 From: davidus01 Date: Sat, 3 Jul 2010 00:34:03 +0000 Subject: editor: mouse support to move notes left click & motion to move note right click & motion to move note with rest notes editor: Line and Note as button editor: PlayOne - variable to play only one note git-svn-id: svn://svn.code.sf.net/p/ultrastardx/svn/branches/experimental@2569 b956fd51-792f-4845-bead-9b4dfca2ff2c --- us_maker_edition/src/base/UMain.pas | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) (limited to 'us_maker_edition/src/base/UMain.pas') diff --git a/us_maker_edition/src/base/UMain.pas b/us_maker_edition/src/base/UMain.pas index 174ef162..c1e45c03 100644 --- a/us_maker_edition/src/base/UMain.pas +++ b/us_maker_edition/src/base/UMain.pas @@ -36,6 +36,8 @@ interface uses SysUtils, SDL; +var + CheckMouseButton: boolean; // for checking mouse motion procedure Main; procedure MainLoop; @@ -425,16 +427,12 @@ begin if (Ini.Mouse > 0) then begin case Event.type_ of - SDL_MOUSEMOTION: - begin - mouseDown := false; - mouseBtn := 0; - end; + SDL_MOUSEBUTTONDOWN: begin mouseDown := true; mouseBtn := Event.button.button; - + CheckMouseButton := true; if (mouseBtn = SDL_BUTTON_LEFT) or (mouseBtn = SDL_BUTTON_RIGHT) then Display.OnMouseButton(true); end; @@ -442,10 +440,18 @@ begin begin mouseDown := false; mouseBtn := Event.button.button; - + CheckMouseButton := false; if (mouseBtn = SDL_BUTTON_LEFT) or (mouseBtn = SDL_BUTTON_RIGHT) then Display.OnMouseButton(false); end; + SDL_MOUSEMOTION: + begin + if (CheckMouseButton) then + mouseDown := true + else + mouseDown := false; + mouseBtn := 0; + end; end; Display.MoveCursor(Event.button.X * 800 * Screens / ScreenW, -- cgit v1.2.3