Shift + arrow keys now steps 8 steps instead of 1

This commit is contained in:
Daniel Collin 2012-10-28 20:41:09 +01:00
parent d120a27fdc
commit e3a04b6e21
3 changed files with 18 additions and 10 deletions

View File

@ -108,7 +108,7 @@ void Editor_update()
static char s_editBuffer[512]; static char s_editBuffer[512];
static bool is_editing = false; static bool is_editing = false;
bool Editor_keyDown(int key) bool Editor_keyDown(int key, int modifiers)
{ {
bool handled_key = true; bool handled_key = true;
bool paused = RemoteConnection_isPaused(); bool paused = RemoteConnection_isPaused();
@ -119,8 +119,12 @@ bool Editor_keyDown(int key)
{ {
if (paused) if (paused)
{ {
int row = ++s_editorData.trackViewInfo.rowPos; if (modifiers)
RemoteConnection_sendSetRowCommand(row); s_editorData.trackViewInfo.rowPos += 8;
else
s_editorData.trackViewInfo.rowPos++;
RemoteConnection_sendSetRowCommand(s_editorData.trackViewInfo.rowPos);
handled_key = true; handled_key = true;
} }
@ -131,15 +135,15 @@ bool Editor_keyDown(int key)
{ {
if (paused) if (paused)
{ {
int row = --s_editorData.trackViewInfo.rowPos; if (modifiers)
s_editorData.trackViewInfo.rowPos -= 8;
else
s_editorData.trackViewInfo.rowPos--;
if (s_editorData.trackViewInfo.rowPos < 0) if (s_editorData.trackViewInfo.rowPos < 0)
{
s_editorData.trackViewInfo.rowPos = 0; s_editorData.trackViewInfo.rowPos = 0;
row = 0;
}
RemoteConnection_sendSetRowCommand(row); RemoteConnection_sendSetRowCommand(s_editorData.trackViewInfo.rowPos);
handled_key = true; handled_key = true;
} }
break; break;

View File

@ -5,7 +5,7 @@ void Editor_destroy();
void Editor_init(); void Editor_init();
void Editor_update(); void Editor_update();
void Editor_timedUpdate(); void Editor_timedUpdate();
bool Editor_keyDown(int keyCode); bool Editor_keyDown(int keyCode, int mod);
void Editor_menuEvent(int menuItem); void Editor_menuEvent(int menuItem);
enum enum

View File

@ -71,6 +71,10 @@
keyChar = [key characterAtIndex:0]; keyChar = [key characterAtIndex:0];
int keyCode = keyChar; int keyCode = keyChar;
int specialKeys = 0;
if ([theEvent modifierFlags] & NSShiftKeyMask)
specialKeys = 1;
if ([theEvent modifierFlags] & NSNumericPadKeyMask) if ([theEvent modifierFlags] & NSNumericPadKeyMask)
{ {
@ -83,7 +87,7 @@
} }
} }
if (!Editor_keyDown(keyCode)) if (!Editor_keyDown(keyCode, specialKeys))
[super keyDown:theEvent]; [super keyDown:theEvent];
Editor_update(); Editor_update();