aboutsummaryrefslogtreecommitdiffstats
path: root/us_maker_edition/src/base/UMain.pas
diff options
context:
space:
mode:
authordavidus01 <davidus01@b956fd51-792f-4845-bead-9b4dfca2ff2c>2010-07-03 00:34:03 +0000
committerdavidus01 <davidus01@b956fd51-792f-4845-bead-9b4dfca2ff2c>2010-07-03 00:34:03 +0000
commit0ab45e4c4c5bfebd97a44264c1cd47cf0b6709ba (patch)
tree7cf32c8c6079667567a3cf2a42385993690bd1c3 /us_maker_edition/src/base/UMain.pas
parent44a4f320c0597b8a222e75b1b548d26260165abb (diff)
downloadusdx-0ab45e4c4c5bfebd97a44264c1cd47cf0b6709ba.tar.gz
usdx-0ab45e4c4c5bfebd97a44264c1cd47cf0b6709ba.tar.xz
usdx-0ab45e4c4c5bfebd97a44264c1cd47cf0b6709ba.zip
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
Diffstat (limited to 'us_maker_edition/src/base/UMain.pas')
-rw-r--r--us_maker_edition/src/base/UMain.pas20
1 files changed, 13 insertions, 7 deletions
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,