diff options
author | tobigun <tobigun@b956fd51-792f-4845-bead-9b4dfca2ff2c> | 2008-03-22 11:58:28 +0000 |
---|---|---|
committer | tobigun <tobigun@b956fd51-792f-4845-bead-9b4dfca2ff2c> | 2008-03-22 11:58:28 +0000 |
commit | dbeaec3a0e5a50c84b70b28ae00a368a3e6e98e9 (patch) | |
tree | bb3633e752ea30874f704be70ec82354d70faf1e /Game/Code | |
parent | a7659bea0fcdec8d1b34955f9c56b066ff27a3cb (diff) | |
download | usdx-dbeaec3a0e5a50c84b70b28ae00a368a3e6e98e9.tar.gz usdx-dbeaec3a0e5a50c84b70b28ae00a368a3e6e98e9.tar.xz usdx-dbeaec3a0e5a50c84b70b28ae00a368a3e6e98e9.zip |
Support for non-US (QWERTY) keyboard layout.
git-svn-id: svn://svn.code.sf.net/p/ultrastardx/svn/trunk@970 b956fd51-792f-4845-bead-9b4dfca2ff2c
Diffstat (limited to 'Game/Code')
30 files changed, 644 insertions, 486 deletions
diff --git a/Game/Code/Screens/UScreenEdit.pas b/Game/Code/Screens/UScreenEdit.pas index 407a37d0..4d105e5f 100644 --- a/Game/Code/Screens/UScreenEdit.pas +++ b/Game/Code/Screens/UScreenEdit.pas @@ -22,19 +22,24 @@ type implementation
-uses UGraphic, UMusic, USkins;
+uses UGraphic, UMusic, USkins, SysUtils;
function TScreenEdit.ParseInput(PressedKey: Cardinal; CharCode: WideChar; PressedDown: Boolean): Boolean;
begin
Result := true;
If (PressedDown) Then
begin // Key Down
- case PressedKey of
- SDLK_Q:
+ // check normal keys
+ case WideUpperCase(CharCode)[1] of
+ 'Q': begin
Result := false;
+ Exit;
end;
-
+ end;
+
+ // check special keys
+ case PressedKey of
SDLK_ESCAPE,
SDLK_BACKSPACE :
begin
diff --git a/Game/Code/Screens/UScreenEditConvert.pas b/Game/Code/Screens/UScreenEditConvert.pas index fe9eab02..d50d546d 100644 --- a/Game/Code/Screens/UScreenEditConvert.pas +++ b/Game/Code/Screens/UScreenEditConvert.pas @@ -108,13 +108,17 @@ begin Result := true; If (PressedDown) Then begin // Key Down + // check normal keys + case WideUpperCase(CharCode)[1] of
+ 'Q': + begin
+ Result := false;
+ Exit;
+ end;
+ end;
+ + // check special keys case PressedKey of - SDLK_Q: - begin - Result := false; - end; - - SDLK_ESCAPE, SDLK_BACKSPACE : begin diff --git a/Game/Code/Screens/UScreenEditHeader.pas b/Game/Code/Screens/UScreenEditHeader.pas index bb464039..3b29564a 100644 --- a/Game/Code/Screens/UScreenEditHeader.pas +++ b/Game/Code/Screens/UScreenEditHeader.pas @@ -58,12 +58,17 @@ var begin
Result := true;
If (PressedDown) Then begin // Key Down
- case PressedKey of
- SDLK_Q:
+ // check normal keys
+ case WideUpperCase(CharCode)[1] of
+ 'Q': begin
Result := false;
+ Exit;
end;
-
+ end;
+
+ // check special keys
+ case PressedKey of
SDLK_ESCAPE :
begin
// Music.PlayBack;
diff --git a/Game/Code/Screens/UScreenEditSub.pas b/Game/Code/Screens/UScreenEditSub.pas index 99d9428f..c75661fc 100644 --- a/Game/Code/Screens/UScreenEditSub.pas +++ b/Game/Code/Screens/UScreenEditSub.pas @@ -118,17 +118,156 @@ begin + KMOD_LCTRL + KMOD_RCTRL + KMOD_LALT + KMOD_RALT {+ KMOD_CAPS}); If (PressedDown) then begin // Key Down - case PressedKey of + // check normal keys + case WideUpperCase(CharCode)[1] of
+ 'Q': + begin
+ Result := false;
+ Exit;
+ end;
+ 'S':
+ begin + // Save Song + if SDL_ModState = KMOD_LSHIFT then + SaveSong(CurrentSong, Lines[0], CurrentSong.Path + CurrentSong.FileName, true) + else + SaveSong(CurrentSong, Lines[0], CurrentSong.Path + CurrentSong.FileName, false); - SDLK_ESCAPE, - SDLK_BACKSPACE : + {if SDL_ModState = KMOD_LSHIFT or KMOD_LCTRL + KMOD_LALT then + // Save Song + SaveSongDebug(CurrentSong, Lines[0], 'C:\song.asm', false);} + + Exit; + end; + 'D': begin - FadeTo(@ScreenSong); + // Divide lengths by 2 + CzesciDivide; + Exit; end; + 'M': + begin + // Multiply lengths by 2 + CzesciMultiply; + Exit; + end; + 'C': + begin + // Capitalize letter at the beginning of line + if SDL_ModState = 0 then + LyricsCapitalize; + + // Correct spaces + if SDL_ModState = KMOD_LSHIFT then + LyricsCorrectSpaces; + + // Copy sentence + if SDL_ModState = KMOD_LCTRL then + MarkSrc; + + Exit; + end; + 'V': + begin + // Paste text + if SDL_ModState = KMOD_LCTRL then begin + if Lines[0].Line[Lines[0].Current].IlNut >= Lines[0].Line[CopySrc].IlNut then + PasteText + else + beep; + end; - SDLK_Q: + if SDL_ModState = KMOD_LCTRL + KMOD_LSHIFT then begin + CopySentence(CopySrc, Lines[0].Current); + end; + end; + 'T':
begin - Result := false; + // Fixes timings between sentences + FixTimings; + Exit; + end; + 'P': + begin + if SDL_ModState = 0 then + begin + // Play Sentence + Click := true; + AudioPlayback.Stop; + R := GetTimeFromBeat(Lines[0].Line[Lines[0].Current].StartNote); + if R <= AudioPlayback.Length then + begin + AudioPlayback.Position := R; + PlayStopTime := GetTimeFromBeat(Lines[0].Line[Lines[0].Current].End_); + PlaySentence := true; + AudioPlayback.Play; + LastClick := -100; + end; + end + else if SDL_ModState = KMOD_LSHIFT then + begin + PlaySentenceMidi := true; + + MidiTime := USTime.GetTime; + MidiStart := GetTimeFromBeat(Lines[0].Line[Lines[0].Current].StartNote); + MidiStop := GetTimeFromBeat(Lines[0].Line[Lines[0].Current].End_); + + LastClick := -100; + end + else if SDL_ModState = KMOD_LSHIFT or KMOD_LCTRL then + begin + PlaySentenceMidi := true; + MidiTime := USTime.GetTime; + MidiStart := GetTimeFromBeat(Lines[0].Line[Lines[0].Current].StartNote); + MidiStop := GetTimeFromBeat(Lines[0].Line[Lines[0].Current].End_); + LastClick := -100; + + PlaySentence := true; + Click := true; + AudioPlayback.Stop; + AudioPlayback.Position := GetTimeFromBeat(Lines[0].Line[Lines[0].Current].StartNote)+0{-0.10}; + PlayStopTime := GetTimeFromBeat(Lines[0].Line[Lines[0].Current].End_)+0; + AudioPlayback.Play; + LastClick := -100; + end; + Exit; + end; + // Golden Note Patch
+ 'G': + begin + case Lines[0].Line[Lines[0].Current].Note[CurrentNote].NoteType of + 0: Lines[0].Line[Lines[0].Current].Note[CurrentNote].NoteType := 2; + 1: Lines[0].Line[Lines[0].Current].Note[CurrentNote].NoteType := 2; + 2: Lines[0].Line[Lines[0].Current].Note[CurrentNote].NoteType := 1; + end; // case + Lines[0].Line[Lines[0].Current].Note[CurrentNote].Freestyle := False; + Exit; + end; + // Freestyle Note Patch + 'F': + begin + case Lines[0].Line[Lines[0].Current].Note[CurrentNote].NoteType of + 0: + begin; + Lines[0].Line[Lines[0].Current].Note[CurrentNote].NoteType := 1; + Lines[0].Line[Lines[0].Current].Note[CurrentNote].Freestyle := False; + end; + 1,2: + begin; + Lines[0].Line[Lines[0].Current].Note[CurrentNote].NoteType := 0; + Lines[0].Line[Lines[0].Current].Note[CurrentNote].Freestyle := True; + end; + end; // case + Exit; + end; + end;
+
+ // check special keys
+ case PressedKey of + SDLK_ESCAPE, + SDLK_BACKSPACE : + begin + FadeTo(@ScreenSong); end; SDLK_BACKQUOTE: @@ -161,13 +300,32 @@ begin CurrentSong.BPM[0].BPM := Round((CurrentSong.BPM[0].BPM * 25) - 1) / 25; end; - SDLK_0: + SDLK_4: begin - // Increase GAP - if SDL_ModState = 0 then - CurrentSong.GAP := CurrentSong.GAP + 10; - if SDL_ModState = KMOD_LSHIFT then - CurrentSong.GAP := CurrentSong.GAP + 1000; + if SDL_ModState = KMOD_LCTRL + KMOD_LSHIFT then begin + CopySentence(CopySrc, Lines[0].Current); + CopySentence(CopySrc+1, Lines[0].Current+1); + CopySentence(CopySrc+2, Lines[0].Current+2); + CopySentence(CopySrc+3, Lines[0].Current+3); + end; + + if SDL_ModState = KMOD_LCTRL + KMOD_LSHIFT + KMOD_LALT then begin + CopySentences(CopySrc, Lines[0].Current, 4); + end; + end; + SDLK_5: + begin + if SDL_ModState = KMOD_LCTRL + KMOD_LSHIFT then begin + CopySentence(CopySrc, Lines[0].Current); + CopySentence(CopySrc+1, Lines[0].Current+1); + CopySentence(CopySrc+2, Lines[0].Current+2); + CopySentence(CopySrc+3, Lines[0].Current+3); + CopySentence(CopySrc+4, Lines[0].Current+4); + end; + + if SDL_ModState = KMOD_LCTRL + KMOD_LSHIFT + KMOD_LALT then begin + CopySentences(CopySrc, Lines[0].Current, 5); + end; end; SDLK_9: @@ -178,6 +336,14 @@ begin if SDL_ModState = KMOD_LSHIFT then CurrentSong.GAP := CurrentSong.GAP - 1000; end; + SDLK_0: + begin + // Increase GAP + if SDL_ModState = 0 then + CurrentSong.GAP := CurrentSong.GAP + 10; + if SDL_ModState = KMOD_LSHIFT then + CurrentSong.GAP := CurrentSong.GAP + 1000; + end; SDLK_KP_PLUS: begin @@ -218,145 +384,12 @@ begin end; - SDLK_S: - begin - // Save Song - if SDL_ModState = KMOD_LSHIFT then - SaveSong(CurrentSong, Lines[0], CurrentSong.Path + CurrentSong.FileName, true) - else - SaveSong(CurrentSong, Lines[0], CurrentSong.Path + CurrentSong.FileName, false); - - {if SDL_ModState = KMOD_LSHIFT or KMOD_LCTRL + KMOD_LALT then - // Save Song - SaveSongDebug(CurrentSong, Lines[0], 'C:\song.asm', false);} - - end; - - SDLK_D: - begin - // Divide lengths by 2 - CzesciDivide; - end; - - SDLK_M: - begin - // Multiply lengths by 2 - CzesciMultiply; - end; - - SDLK_C: - begin - // Capitalize letter at the beginning of line - if SDL_ModState = 0 then - LyricsCapitalize; - - // Correct spaces - if SDL_ModState = KMOD_LSHIFT then - LyricsCorrectSpaces; - - // Copy sentence - if SDL_ModState = KMOD_LCTRL then - MarkSrc; - end; - - SDLK_V: - begin - // Paste text - if SDL_ModState = KMOD_LCTRL then begin - if Lines[0].Line[Lines[0].Current].IlNut >= Lines[0].Line[CopySrc].IlNut then - PasteText - else - beep; - end; - - if SDL_ModState = KMOD_LCTRL + KMOD_LSHIFT then begin - CopySentence(CopySrc, Lines[0].Current); - end; - end; - - SDLK_4: - begin - if SDL_ModState = KMOD_LCTRL + KMOD_LSHIFT then begin - CopySentence(CopySrc, Lines[0].Current); - CopySentence(CopySrc+1, Lines[0].Current+1); - CopySentence(CopySrc+2, Lines[0].Current+2); - CopySentence(CopySrc+3, Lines[0].Current+3); - end; - - if SDL_ModState = KMOD_LCTRL + KMOD_LSHIFT + KMOD_LALT then begin - CopySentences(CopySrc, Lines[0].Current, 4); - end; - end; - SDLK_5: - begin - if SDL_ModState = KMOD_LCTRL + KMOD_LSHIFT then begin - CopySentence(CopySrc, Lines[0].Current); - CopySentence(CopySrc+1, Lines[0].Current+1); - CopySentence(CopySrc+2, Lines[0].Current+2); - CopySentence(CopySrc+3, Lines[0].Current+3); - CopySentence(CopySrc+4, Lines[0].Current+4); - end; - - if SDL_ModState = KMOD_LCTRL + KMOD_LSHIFT + KMOD_LALT then begin - CopySentences(CopySrc, Lines[0].Current, 5); - end; - end; - - SDLK_T: - begin - // Fixes timings between sentences - FixTimings; - end; - SDLK_F4: begin // Enter Text Edit Mode TextEditMode := true; end; - SDLK_P: - begin - if SDL_ModState = 0 then begin - // Play Sentence - Click := true; - AudioPlayback.Stop; - R := GetTimeFromBeat(Lines[0].Line[Lines[0].Current].StartNote); - if R <= AudioPlayback.Length then - begin - AudioPlayback.Position := R; - PlayStopTime := GetTimeFromBeat(Lines[0].Line[Lines[0].Current].End_); - PlaySentence := true; - AudioPlayback.Play; - LastClick := -100; - end; - end; - - if SDL_ModState = KMOD_LSHIFT then begin - PlaySentenceMidi := true; - - MidiTime := USTime.GetTime; - MidiStart := GetTimeFromBeat(Lines[0].Line[Lines[0].Current].StartNote); - MidiStop := GetTimeFromBeat(Lines[0].Line[Lines[0].Current].End_); - - LastClick := -100; - end; - if SDL_ModState = KMOD_LSHIFT or KMOD_LCTRL then begin - PlaySentenceMidi := true; - MidiTime := USTime.GetTime; - MidiStart := GetTimeFromBeat(Lines[0].Line[Lines[0].Current].StartNote); - MidiStop := GetTimeFromBeat(Lines[0].Line[Lines[0].Current].End_); - LastClick := -100; - - PlaySentence := true; - Click := true; - AudioPlayback.Stop; - AudioPlayback.Position := GetTimeFromBeat(Lines[0].Line[Lines[0].Current].StartNote)+0{-0.10}; - PlayStopTime := GetTimeFromBeat(Lines[0].Line[Lines[0].Current].End_)+0; - AudioPlayback.Play; - LastClick := -100; - end; - end; - SDLK_SPACE: begin // Play Sentence @@ -549,37 +582,7 @@ begin {$endif} end; - // Golden Note Patch - SDLK_G: - begin - case Lines[0].Line[Lines[0].Current].Note[CurrentNote].NoteType of - 0: Lines[0].Line[Lines[0].Current].Note[CurrentNote].NoteType := 2; - 1: Lines[0].Line[Lines[0].Current].Note[CurrentNote].NoteType := 2; - 2: Lines[0].Line[Lines[0].Current].Note[CurrentNote].NoteType := 1; - end; // case - Lines[0].Line[Lines[0].Current].Note[CurrentNote].Freestyle := False; - end; - - // Freestyle Note Patch - SDLK_F: - begin - case Lines[0].Line[Lines[0].Current].Note[CurrentNote].NoteType of - 0: - begin; - Lines[0].Line[Lines[0].Current].Note[CurrentNote].NoteType := 1; - Lines[0].Line[Lines[0].Current].Note[CurrentNote].Freestyle := False; - end; - 1,2: - begin; - Lines[0].Line[Lines[0].Current].Note[CurrentNote].NoteType := 0; - Lines[0].Line[Lines[0].Current].Note[CurrentNote].Freestyle := True; - end; - end; // case - - end; - - - end; + end; // case end; end; // if end; diff --git a/Game/Code/Screens/UScreenLevel.pas b/Game/Code/Screens/UScreenLevel.pas index 02939385..144ec697 100644 --- a/Game/Code/Screens/UScreenLevel.pas +++ b/Game/Code/Screens/UScreenLevel.pas @@ -29,12 +29,17 @@ begin Result := true; If (PressedDown) Then begin // Key Down + // check normal keys + case WideUpperCase(CharCode)[1] of
+ 'Q': + begin
+ Result := false;
+ Exit;
+ end;
+ end;
+
+ // check special keys
case PressedKey of - SDLK_Q: - begin - Result := false; - end; - SDLK_ESCAPE, SDLK_BACKSPACE : begin diff --git a/Game/Code/Screens/UScreenMain.pas b/Game/Code/Screens/UScreenMain.pas index 44906858..2d13ac09 100644 --- a/Game/Code/Screens/UScreenMain.pas +++ b/Game/Code/Screens/UScreenMain.pas @@ -73,19 +73,14 @@ begin If (PressedDown) Then begin // Key Down - case PressedKey of - SDLK_Q: + // check normal keys + case WideUpperCase(CharCode)[1] of + 'Q': begin Result := false; + Exit; end; - - SDLK_ESCAPE, - SDLK_BACKSPACE : - begin - Result := False; - end; - - SDLK_C: + 'C': begin if (SDL_ModState = KMOD_LALT) then begin @@ -93,24 +88,37 @@ begin //Credits_Alpha := 0; //Credits_Visible := True; FadeTo(@ScreenCredits , SoundLib.Start ); + Exit; end; end; - SDLK_M: + 'M': begin if (Ini.Players >= 1) AND (Length(DLLMan.Plugins)>=1) then begin FadeTo(@ScreenPartyOptions, SoundLib.Start); + Exit; end; end; - SDLK_S: + 'S': begin FadeTo(@ScreenStatMain, SoundLib.Start); + Exit; end; - SDLK_E: + 'E': begin FadeTo(@ScreenEdit, SoundLib.Start); + Exit; + end; + end; + + // check special keys + case PressedKey of + SDLK_ESCAPE, + SDLK_BACKSPACE : + begin + Result := False; end; SDLK_RETURN: diff --git a/Game/Code/Screens/UScreenName.pas b/Game/Code/Screens/UScreenName.pas index adbc2c25..6d3e81b4 100644 --- a/Game/Code/Screens/UScreenName.pas +++ b/Game/Code/Screens/UScreenName.pas @@ -19,7 +19,8 @@ type implementation
-uses UGraphic, UMain, UIni, UTexture;
+uses UGraphic, UMain, UIni, UTexture, UCommon;
+
function TScreenName.ParseInput(PressedKey: Cardinal; CharCode: WideChar; PressedDown: Boolean): Boolean;
var
@@ -33,12 +34,16 @@ begin SDL_ModState := SDL_GetModState and (KMOD_LSHIFT + KMOD_RSHIFT
+ KMOD_LCTRL + KMOD_RCTRL + KMOD_LALT + KMOD_RALT);
- case PressedKey of
- SDLK_0..SDLK_9, SDLK_A..SDLK_Z, SDLK_SPACE, SDLK_MINUS, SDLK_EXCLAIM, SDLK_COMMA, SDLK_SLASH, SDLK_ASTERISK, SDLK_QUESTION, SDLK_QUOTE, SDLK_QUOTEDBL:
- begin
- Button[Interaction].Text[0].Text := Button[Interaction].Text[0].Text + CharCode;
- end;
+ // check normal keys
+ if (IsAlphaNumericChar(CharCode) or
+ (CharCode in [' ','-','_','!',',','<','/','*','?','''','"'])) then
+ begin
+ Button[Interaction].Text[0].Text := Button[Interaction].Text[0].Text + CharCode;
+ Exit;
+ end;
+ // check special keys
+ case PressedKey of
// Templates for Names Mod
SDLK_F1:
if (SDL_ModState = KMOD_LALT) then
diff --git a/Game/Code/Screens/UScreenOpen.pas b/Game/Code/Screens/UScreenOpen.pas index b069f3c8..3a15f26f 100644 --- a/Game/Code/Screens/UScreenOpen.pas +++ b/Game/Code/Screens/UScreenOpen.pas @@ -31,9 +31,11 @@ uses UGraphic, UDraw, UMain, USkins; function TScreenOpen.ParseInput(PressedKey: Cardinal; CharCode: WideChar; PressedDown: Boolean): Boolean;
begin
Result := true;
+
if (PressedDown) then begin // Key Down
+ // check normal keys
case CharCode of
- 'a'..'z', 'A'..'Z', '0'..'9', #32, '-', '.', ':', '\':
+ '0'..'9', 'a'..'z', 'A'..'Z', ' ', '-', '.', ':', '\':
begin
if Interaction = 0 then begin
Text[TextN].Text := Text[TextN].Text + CharCode;
@@ -41,6 +43,7 @@ begin end;
end;
+ // check special keys
case PressedKey of
SDLK_Q:
begin
diff --git a/Game/Code/Screens/UScreenOptions.pas b/Game/Code/Screens/UScreenOptions.pas index 9c4567d1..cfb0c977 100644 --- a/Game/Code/Screens/UScreenOptions.pas +++ b/Game/Code/Screens/UScreenOptions.pas @@ -28,12 +28,17 @@ begin Result := true; If (PressedDown) Then begin // Key Down + // check normal keys + case WideUpperCase(CharCode)[1] of
+ 'Q': + begin
+ Result := false;
+ Exit;
+ end;
+ end;
+
+ // check special keys
case PressedKey of - SDLK_Q: - begin - Result := false; - end; - SDLK_ESCAPE, SDLK_BACKSPACE : begin diff --git a/Game/Code/Screens/UScreenOptionsAdvanced.pas b/Game/Code/Screens/UScreenOptionsAdvanced.pas index a09a5354..c23f133c 100644 --- a/Game/Code/Screens/UScreenOptionsAdvanced.pas +++ b/Game/Code/Screens/UScreenOptionsAdvanced.pas @@ -17,19 +17,24 @@ type implementation -uses UGraphic; +uses UGraphic, SysUtils; function TScreenOptionsAdvanced.ParseInput(PressedKey: Cardinal; CharCode: WideChar; PressedDown: Boolean): Boolean; begin Result := true; If (PressedDown) Then begin // Key Down + // check normal keys + case WideUpperCase(CharCode)[1] of
+ 'Q': + begin
+ Result := false;
+ Exit;
+ end;
+ end;
+
+ // check special keys
case PressedKey of - SDLK_Q: - begin - Result := false; - end; - SDLK_ESCAPE, SDLK_BACKSPACE : begin diff --git a/Game/Code/Screens/UScreenOptionsGame.pas b/Game/Code/Screens/UScreenOptionsGame.pas index 063e36ed..40200c60 100644 --- a/Game/Code/Screens/UScreenOptionsGame.pas +++ b/Game/Code/Screens/UScreenOptionsGame.pas @@ -19,19 +19,24 @@ type implementation -uses UGraphic; +uses UGraphic, SysUtils; function TScreenOptionsGame.ParseInput(PressedKey: Cardinal; CharCode: WideChar; PressedDown: Boolean): Boolean; begin Result := true; If (PressedDown) Then begin // Key Down + // check normal keys + case WideUpperCase(CharCode)[1] of
+ 'Q': + begin
+ Result := false;
+ Exit;
+ end;
+ end;
+
+ // check special keys
case PressedKey of - SDLK_Q: - begin - Result := false; - end; - SDLK_ESCAPE, SDLK_BACKSPACE : begin diff --git a/Game/Code/Screens/UScreenOptionsGraphics.pas b/Game/Code/Screens/UScreenOptionsGraphics.pas index 0825764d..04656e97 100644 --- a/Game/Code/Screens/UScreenOptionsGraphics.pas +++ b/Game/Code/Screens/UScreenOptionsGraphics.pas @@ -17,19 +17,24 @@ type implementation
-uses UGraphic, UMain;
+uses UGraphic, UMain, SysUtils;
function TScreenOptionsGraphics.ParseInput(PressedKey: Cardinal; CharCode: WideChar; PressedDown: Boolean): Boolean;
begin
Result := true;
If (PressedDown) Then
begin // Key Down
- case PressedKey of
- SDLK_Q:
+ // check normal keys
+ case WideUpperCase(CharCode)[1] of
+ 'Q': begin
Result := false;
+ Exit;
end;
-
+ end;
+
+ // check special keys
+ case PressedKey of
SDLK_ESCAPE,
SDLK_BACKSPACE :
begin
diff --git a/Game/Code/Screens/UScreenOptionsLyrics.pas b/Game/Code/Screens/UScreenOptionsLyrics.pas index 5130c6b0..50b7d53d 100644 --- a/Game/Code/Screens/UScreenOptionsLyrics.pas +++ b/Game/Code/Screens/UScreenOptionsLyrics.pas @@ -17,19 +17,24 @@ type implementation
-uses UGraphic;
+uses UGraphic, SysUtils;
function TScreenOptionsLyrics.ParseInput(PressedKey: Cardinal; CharCode: WideChar; PressedDown: Boolean): Boolean;
begin
Result := true;
If (PressedDown) Then
begin // Key Down
- case PressedKey of
- SDLK_Q:
+ // check normal keys
+ case WideUpperCase(CharCode)[1] of
+ 'Q': begin
Result := false;
+ Exit;
end;
-
+ end;
+
+ // check special keys
+ case PressedKey of
SDLK_ESCAPE,
SDLK_BACKSPACE :
begin
diff --git a/Game/Code/Screens/UScreenOptionsRecord.pas b/Game/Code/Screens/UScreenOptionsRecord.pas index 8a1192db..0ba554c4 100644 --- a/Game/Code/Screens/UScreenOptionsRecord.pas +++ b/Game/Code/Screens/UScreenOptionsRecord.pas @@ -77,11 +77,17 @@ begin Result := true;
If (PressedDown) Then
begin // Key Down
- case PressedKey of
- SDLK_Q:
+ // check normal keys
+ case WideUpperCase(CharCode)[1] of
+ 'Q': begin
Result := false;
+ Exit;
end;
+ end;
+
+ // check special keys
+ case PressedKey of
SDLK_ESCAPE,
SDLK_BACKSPACE:
begin
diff --git a/Game/Code/Screens/UScreenOptionsSound.pas b/Game/Code/Screens/UScreenOptionsSound.pas index 78a24f4a..70d92fa5 100644 --- a/Game/Code/Screens/UScreenOptionsSound.pas +++ b/Game/Code/Screens/UScreenOptionsSound.pas @@ -17,19 +17,24 @@ type implementation -uses UGraphic; +uses UGraphic, SysUtils; function TScreenOptionsSound.ParseInput(PressedKey: Cardinal; CharCode: WideChar; PressedDown: Boolean): Boolean; begin Result := true; If (PressedDown) Then begin // Key Down + // check normal keys + case WideUpperCase(CharCode)[1] of
+ 'Q': + begin
+ Result := false;
+ Exit;
+ end;
+ end;
+
+ // check special keys
case PressedKey of - SDLK_Q: - begin - Result := false; - end; - SDLK_ESCAPE, SDLK_BACKSPACE : begin diff --git a/Game/Code/Screens/UScreenOptionsThemes.pas b/Game/Code/Screens/UScreenOptionsThemes.pas index 7024e8c1..c50256a2 100644 --- a/Game/Code/Screens/UScreenOptionsThemes.pas +++ b/Game/Code/Screens/UScreenOptionsThemes.pas @@ -30,19 +30,25 @@ implementation uses UMain, UGraphic, - USkins; + USkins, + SysUtils; function TScreenOptionsThemes.ParseInput(PressedKey: Cardinal; CharCode: WideChar; PressedDown: Boolean): Boolean; begin Result := true; If (PressedDown) Then begin // Key Down + // check normal keys + case WideUpperCase(CharCode)[1] of
+ 'Q': + begin
+ Result := false;
+ Exit;
+ end;
+ end;
+
+ // check special keys
case PressedKey of - SDLK_Q: - begin - Result := false; - end; - SDLK_ESCAPE, SDLK_BACKSPACE : begin diff --git a/Game/Code/Screens/UScreenPartyNewRound.pas b/Game/Code/Screens/UScreenPartyNewRound.pas index e849f776..e7e2c682 100644 --- a/Game/Code/Screens/UScreenPartyNewRound.pas +++ b/Game/Code/Screens/UScreenPartyNewRound.pas @@ -91,13 +91,17 @@ begin Result := true; If (PressedDown) Then begin // Key Down + // check normal keys + case WideUpperCase(CharCode)[1] of
+ 'Q': + begin
+ Result := false;
+ Exit;
+ end;
+ end;
+ + // check special keys case PressedKey of - SDLK_Q: - begin - Result := false; - end; - - SDLK_ESCAPE, SDLK_BACKSPACE : begin diff --git a/Game/Code/Screens/UScreenPartyOptions.pas b/Game/Code/Screens/UScreenPartyOptions.pas index f72ed137..c0dde4cc 100644 --- a/Game/Code/Screens/UScreenPartyOptions.pas +++ b/Game/Code/Screens/UScreenPartyOptions.pas @@ -56,13 +56,17 @@ begin Result := true; If (PressedDown) Then begin // Key Down + // check normal keys + case WideUpperCase(CharCode)[1] of
+ 'Q': + begin
+ Result := false;
+ Exit;
+ end;
+ end;
+ + // check special keys case PressedKey of - SDLK_Q: - begin - Result := false; - end; - - SDLK_ESCAPE, SDLK_BACKSPACE : begin diff --git a/Game/Code/Screens/UScreenPartyPlayer.pas b/Game/Code/Screens/UScreenPartyPlayer.pas index af603497..c8600c9b 100644 --- a/Game/Code/Screens/UScreenPartyPlayer.pas +++ b/Game/Code/Screens/UScreenPartyPlayer.pas @@ -64,12 +64,17 @@ begin SDL_ModState := 0; begin // Key Down - case PressedKey of - SDLK_0..SDLK_9, SDLK_A..SDLK_Z, SDLK_SPACE, SDLK_MINUS, SDLK_EXCLAIM, SDLK_COMMA, SDLK_SLASH, SDLK_ASTERISK, SDLK_QUESTION, SDLK_QUOTE, SDLK_QUOTEDBL: + // check normal keys + case CharCode of
+ '0'..'9', 'a'..'z', 'A'..'Z', ' ', '-', '_', '!', ',', '<', '/', '*', '?', '''', '"': begin Button[Interaction].Text[0].Text := Button[Interaction].Text[0].Text + CharCode; + Exit; end; - + end; +
+ // check special keys
+ case PressedKey of // Templates for Names Mod SDLK_F1: if (SDL_ModState = KMOD_LALT) then diff --git a/Game/Code/Screens/UScreenPartyScore.pas b/Game/Code/Screens/UScreenPartyScore.pas index d9f1db1c..26e53fcf 100644 --- a/Game/Code/Screens/UScreenPartyScore.pas +++ b/Game/Code/Screens/UScreenPartyScore.pas @@ -49,13 +49,17 @@ begin Result := true;
If (PressedDown) Then
begin // Key Down
- case PressedKey of
- SDLK_Q:
+ // check normal keys
+ case WideUpperCase(CharCode)[1] of
+ 'Q': begin
Result := false;
+ Exit;
end;
-
-
+ end;
+ + // check special keys + case PressedKey of
SDLK_ESCAPE,
SDLK_BACKSPACE :
begin
diff --git a/Game/Code/Screens/UScreenPartyWin.pas b/Game/Code/Screens/UScreenPartyWin.pas index e91d20f0..02079b34 100644 --- a/Game/Code/Screens/UScreenPartyWin.pas +++ b/Game/Code/Screens/UScreenPartyWin.pas @@ -42,13 +42,17 @@ begin Result := true; If (PressedDown) Then begin // Key Down + // check normal keys + case WideUpperCase(CharCode)[1] of
+ 'Q': + begin
+ Result := false;
+ Exit;
+ end;
+ end;
+ + // check special keys case PressedKey of - SDLK_Q: - begin - Result := false; - end; - - SDLK_ESCAPE, SDLK_BACKSPACE : begin diff --git a/Game/Code/Screens/UScreenPopup.pas b/Game/Code/Screens/UScreenPopup.pas index cb524a72..c4541050 100644 --- a/Game/Code/Screens/UScreenPopup.pas +++ b/Game/Code/Screens/UScreenPopup.pas @@ -48,13 +48,17 @@ begin Result := true;
If (PressedDown) Then
begin // Key Down
-
- case PressedKey of
- SDLK_Q:
+ // check normal keys
+ case WideUpperCase(CharCode)[1] of
+ 'Q': begin
Result := false;
+ Exit;
end;
-
+ end;
+ + // check special keys + case PressedKey of
SDLK_ESCAPE,
SDLK_BACKSPACE :
begin
diff --git a/Game/Code/Screens/UScreenScore.pas b/Game/Code/Screens/UScreenScore.pas index cee794fc..358c18d8 100644 --- a/Game/Code/Screens/UScreenScore.pas +++ b/Game/Code/Screens/UScreenScore.pas @@ -149,12 +149,17 @@ function TScreenScore.ParseInput(PressedKey: Cardinal; CharCode: WideChar; Press begin
Result := true;
If (PressedDown) Then begin
- case PressedKey of
- SDLK_Q:
+ // check normal keys
+ case WideUpperCase(CharCode)[1] of
+ 'Q': begin
Result := false;
+ Exit;
end;
-
+ end;
+ + // check special keys + case PressedKey of
SDLK_ESCAPE,
SDLK_BACKSPACE :
diff --git a/Game/Code/Screens/UScreenSing.pas b/Game/Code/Screens/UScreenSing.pas index 9c64c01b..6d05c145 100644 --- a/Game/Code/Screens/UScreenSing.pas +++ b/Game/Code/Screens/UScreenSing.pas @@ -134,19 +134,43 @@ begin Result := true; If (PressedDown) Then begin // Key Down - case PressedKey of - SDLK_Q: - begin + // check normal keys + case WideUpperCase(CharCode)[1] of
+ 'Q': + begin
//When not ask before Exit then Finish now if (Ini.AskbeforeDel <> 1) then Finish - //else just Pause and let the Popup make the Work + //else just Pause and let the Popup make the Work else if not paused then Pause; - + Result := false; + Exit; + end; + 'V': //Show Visualization
+ begin + fShowVisualization := not fShowVisualization; + + if fShowVisualization then + fCurrentVideoPlaybackEngine := Visualization + else + fCurrentVideoPlaybackEngine := VideoPlayback; + + if fShowVisualization then + fCurrentVideoPlaybackEngine.play; + + Exit; + end; + 'P':
+ begin + Pause; + Exit; end; + end;
+ // check special keys + case PressedKey of SDLK_ESCAPE, SDLK_BACKSPACE : begin @@ -158,26 +182,11 @@ begin FadeTo(@ScreenScore); end; - SDLK_P, - SDLK_SPACE://Pause Mod + SDLK_SPACE: begin Pause; end; - SDLK_V: //Show Visualization - begin - fShowVisualization := not fShowVisualization; - - if fShowVisualization then - fCurrentVideoPlaybackEngine := Visualization - else - fCurrentVideoPlaybackEngine := VideoPlayback; - - if fShowVisualization then - fCurrentVideoPlaybackEngine.play; - - end; - SDLK_TAB: //Change Visualization Preset begin if fShowVisualization then diff --git a/Game/Code/Screens/UScreenSong.pas b/Game/Code/Screens/UScreenSong.pas index f1fef22b..a1cd8748 100644 --- a/Game/Code/Screens/UScreenSong.pas +++ b/Game/Code/Screens/UScreenSong.pas @@ -254,63 +254,192 @@ begin + KMOD_LCTRL + KMOD_RCTRL + KMOD_LALT + KMOD_RALT);
//Jump to Artist/Titel
- if (SDL_ModState and KMOD_LALT <> 0) AND (Mode = smNormal) AND (PressedKey >= SDLK_A) AND (PressedKey <= SDLK_Z) then
+ if ((SDL_ModState and KMOD_LALT <> 0) AND (Mode = smNormal)) then
begin
- Letter := WideUpperCase(CharCode)[1];
- I2 := Length(CatSongs.Song);
-
- //Jump To Titel
- if (SDL_ModState = KMOD_LALT or KMOD_LSHIFT) then
+ if (WideUpperCase(CharCode)[1] in ['A'..'Z']) then
begin
- For I := 1 to high(CatSongs.Song) do
+ Letter := WideUpperCase(CharCode)[1];
+ I2 := Length(CatSongs.Song);
+
+ //Jump To Titel
+ if (SDL_ModState = (KMOD_LALT or KMOD_LSHIFT)) then
begin
- if (CatSongs.Song[(I + Interaction) mod I2].Visible) AND
- (Length(CatSongs.Song[(I + Interaction) mod I2].Title)>0) AND
- (WideUpperCase(CatSongs.Song[(I + Interaction) mod I2].Title)[1] = Letter) then
+ For I := 1 to high(CatSongs.Song) do
begin
- SkipTo(CatSongs.VisibleIndex((I + Interaction) mod I2));
+ if (CatSongs.Song[(I + Interaction) mod I2].Visible) AND
+ (Length(CatSongs.Song[(I + Interaction) mod I2].Title)>0) AND
+ (WideUpperCase(CatSongs.Song[(I + Interaction) mod I2].Title)[1] = Letter) then
+ begin
+ SkipTo(CatSongs.VisibleIndex((I + Interaction) mod I2));
- AudioPlayback.PlaySound(SoundLib.Change);
+ AudioPlayback.PlaySound(SoundLib.Change);
- ChangeMusic;
- SetScroll4;
- //UpdateLCD; //TODO: maybe LCD Support as Plugin?
- //Break and Exit
- Exit;
+ ChangeMusic;
+ SetScroll4;
+ //UpdateLCD; //TODO: maybe LCD Support as Plugin?
+ //Break and Exit
+ Exit;
+ end;
end;
- end;
- end
- //Jump to Artist
- else if (SDL_ModState = KMOD_LALT) then
- begin
- For I := 1 to high(CatSongs.Song) do
+ end
+ //Jump to Artist
+ else if (SDL_ModState = KMOD_LALT) then
begin
- if (CatSongs.Song[(I + Interaction) mod I2].Visible) AND
- (Length(CatSongs.Song[(I + Interaction) mod I2].Artist)>0) AND
- (WideUpperCase(CatSongs.Song[(I + Interaction) mod I2].Artist)[1] = Letter) then
+ For I := 1 to high(CatSongs.Song) do
begin
- SkipTo(CatSongs.VisibleIndex((I + Interaction) mod I2));
+ if (CatSongs.Song[(I + Interaction) mod I2].Visible) AND
+ (Length(CatSongs.Song[(I + Interaction) mod I2].Artist)>0) AND
+ (WideUpperCase(CatSongs.Song[(I + Interaction) mod I2].Artist)[1] = Letter) then
+ begin
+ SkipTo(CatSongs.VisibleIndex((I + Interaction) mod I2));
- AudioPlayback.PlaySound(SoundLib.Change);
+ AudioPlayback.PlaySound(SoundLib.Change);
- ChangeMusic;
- SetScroll4;
- //UpdateLCD; //TODO: maybe LCD Support as Plugin?
+ ChangeMusic;
+ SetScroll4;
+ //UpdateLCD; //TODO: maybe LCD Support as Plugin?
- //Break and Exit
- Exit;
+ //Break and Exit
+ Exit;
+ end;
end;
end;
end;
+
Exit;
end;
- case PressedKey of
- SDLK_Q:
+ // check normal keys
+ case WideUpperCase(CharCode)[1] of
+ 'Q': begin
Result := false;
+ Exit;
end;
+ 'M': //Show SongMenu
+ begin
+ if (Songs.SongList.Count > 0) then begin
+ if (Mode = smNormal) then begin
+ if not CatSongs.Song[Interaction].Main then begin // clicked on Song
+ if CatSongs.CatNumShow = -3 then
+ ScreenSongMenu.MenuShow(SM_Playlist)
+ else
+ ScreenSongMenu.MenuShow(SM_Main);
+ end
+ else
+ begin
+ ScreenSongMenu.MenuShow(SM_Playlist_Load);
+ end;
+ end //Party Mode -> Show Party Menu
+ else ScreenSongMenu.MenuShow(SM_Party_Main);
+ end;
+ Exit;
+ end;
+
+ 'P': //Show Playlist Menu
+ begin
+ if (Songs.SongList.Count > 0) AND (Mode = smNormal) then begin
+ ScreenSongMenu.MenuShow(SM_Playlist_Load);
+ end;
+ Exit;
+ end;
+
+ 'J': //Show Jumpto Menu
+ begin
+ if (Songs.SongList.Count > 0) AND (Mode = smNormal) then
+ begin
+ ScreenSongJumpto.Visible := True;
+ end;
+ Exit;
+ end;
+
+ 'E':
+ begin
+ OpenEditor;
+ Exit;
+ end;
+
+ 'R':
+ begin
+ if (Songs.SongList.Count > 0) AND (Mode = smNormal) then begin
+
+ if (SDL_ModState = KMOD_LSHIFT) AND (Ini.Tabs_at_startup = 1) then //Random Category
+ begin
+ I2 := 0; //Count Cats
+ for I:= low(CatSongs.Song) to high (CatSongs.Song) do
+ if CatSongs.Song[I].Main then Inc(I2);
+
+ I2 := Random (I2)+1; //Zufall
+
+ //Find Cat:
+ for I:= low(CatSongs.Song) to high (CatSongs.Song) do
+ begin
+ if CatSongs.Song[I].Main then
+ Dec(I2);
+ if (I2<=0) then
+ begin
+ //Show Cat in Top Left Mod
+ ShowCatTL (I);
+
+ Interaction := I;
+
+ CatSongs.ShowCategoryList;
+ CatSongs.ClickCategoryButton(I);
+ SelectNext;
+ FixSelected;
+ break;
+ end;
+ end;
+
+
+ end
+ else if (SDL_ModState = KMOD_LCTRL) AND (Ini.Tabs_at_startup = 1) then //random in All Categorys
+ begin
+ repeat
+ I2 := Random(high(CatSongs.Song)+1) - low(CatSongs.Song)+1;
+ until CatSongs.Song[I2].Main = false;
+
+ //Search Cat
+ for I := I2 downto low(CatSongs.Song) do
+ begin
+ if CatSongs.Song[I].Main then
+ break;
+ end;
+ //In I is now the categorie in I2 the song
+
+ //Choose Cat
+ CatSongs.ShowCategoryList;
+
+ //Show Cat in Top Left Mod
+ ShowCatTL (I);
+
+ CatSongs.ClickCategoryButton(I);
+ SelectNext;
+
+ //Fix: Not Existing Song selected:
+ //if (I+1=I2) then Inc(I2);
+
+ //Choose Song
+ SkipTo(I2-I);
+
+ end
+ else //Random in one Category
+ begin
+ SkipTo(Random(CatSongs.VisibleSongs));
+ end;
+ AudioPlayback.PlaySound(SoundLib.Change);
+
+ ChangeMusic;
+ SetScroll4;
+ //UpdateLCD; //TODO: maybe LCD Support as Plugin?
+ end;
+ Exit;
+ end;
+ end; // normal keys
+
+ // check special keys
+ case PressedKey of
SDLK_ESCAPE,
SDLK_BACKSPACE :
begin
@@ -440,40 +569,6 @@ begin end;
end;
- SDLK_M: //Show SongMenu
- begin
- if (Songs.SongList.Count > 0) then begin
- if (Mode = smNormal) then begin
- if not CatSongs.Song[Interaction].Main then begin // clicked on Song
- if CatSongs.CatNumShow = -3 then
- ScreenSongMenu.MenuShow(SM_Playlist)
- else
- ScreenSongMenu.MenuShow(SM_Main);
- end
- else
- begin
- ScreenSongMenu.MenuShow(SM_Playlist_Load);
- end;
- end //Party Mode -> Show Party Menu
- else ScreenSongMenu.MenuShow(SM_Party_Main);
- end;
- end;
-
- SDLK_P: //Show Playlist Menu
- begin
- if (Songs.SongList.Count > 0) AND (Mode = smNormal) then begin
- ScreenSongMenu.MenuShow(SM_Playlist_Load);
- end;
- end;
-
- SDLK_J: //Show Jumpto Menu
- begin
- if (Songs.SongList.Count > 0) AND (Mode = smNormal) then
- begin
- ScreenSongJumpto.Visible := True;
- end;
- end;
-
SDLK_DOWN:
begin
if (Mode = smNormal) then
@@ -582,87 +677,6 @@ begin end;
end;
- SDLK_E:
- begin
- OpenEditor;
- end;
-
- SDLK_R:
- begin
- if (Songs.SongList.Count > 0) AND (Mode = smNormal) then begin
-
- if (SDL_ModState = KMOD_LSHIFT) AND (Ini.Tabs_at_startup = 1) then //Random Category
- begin
- I2 := 0; //Count Cats
- for I:= low(CatSongs.Song) to high (CatSongs.Song) do
- if CatSongs.Song[I].Main then Inc(I2);
-
- I2 := Random (I2)+1; //Zufall
-
- //Find Cat:
- for I:= low(CatSongs.Song) to high (CatSongs.Song) do
- begin
- if CatSongs.Song[I].Main then
- Dec(I2);
- if (I2<=0) then
- begin
- //Show Cat in Top Left Mod
- ShowCatTL (I);
-
- Interaction := I;
-
- CatSongs.ShowCategoryList;
- CatSongs.ClickCategoryButton(I);
- SelectNext;
- FixSelected;
- break;
- end;
- end;
-
-
- end
- else if (SDL_ModState = KMOD_LCTRL) AND (Ini.Tabs_at_startup = 1) then //random in All Categorys
- begin
- repeat
- I2 := Random(high(CatSongs.Song)+1) - low(CatSongs.Song)+1;
- until CatSongs.Song[I2].Main = false;
-
- //Search Cat
- for I := I2 downto low(CatSongs.Song) do
- begin
- if CatSongs.Song[I].Main then
- break;
- end;
- //In I is now the categorie in I2 the song
-
- //Choose Cat
- CatSongs.ShowCategoryList;
-
- //Show Cat in Top Left Mod
- ShowCatTL (I);
-
- CatSongs.ClickCategoryButton(I);
- SelectNext;
-
- //Fix: Not Existing Song selected:
- //if (I+1=I2) then Inc(I2);
-
- //Choose Song
- SkipTo(I2-I);
-
- end
- else //Random in one Category
- begin
- SkipTo(Random(CatSongs.VisibleSongs));
- end;
- AudioPlayback.PlaySound(SoundLib.Change);
-
- ChangeMusic;
- SetScroll4;
- //UpdateLCD; //TODO: maybe LCD Support as Plugin?
- end;
- end;
-
SDLK_1:
begin //Joker // to-do : Party
{if (Mode = smPartyMode) AND (PartySession.Teams.NumTeams >= 1) AND (PartySession.Teams.Teaminfo[0].Joker > 0) then
diff --git a/Game/Code/Screens/UScreenSongJumpto.pas b/Game/Code/Screens/UScreenSongJumpto.pas index a98edec5..89d198cc 100644 --- a/Game/Code/Screens/UScreenSongJumpto.pas +++ b/Game/Code/Screens/UScreenSongJumpto.pas @@ -44,8 +44,10 @@ begin Result := true; If (PressedDown) Then begin // Key Down - case PressedKey of - SDLK_0..SDLK_9, SDLK_A..SDLK_Z, SDLK_SPACE, SDLK_MINUS, SDLK_EXCLAIM, SDLK_COMMA, SDLK_SLASH, SDLK_ASTERISK, SDLK_QUESTION, SDLK_QUOTE, SDLK_QUOTEDBL, SDLK_LEFTBRACKET, SDLK_SEMICOLON: + // check normal keys + case CharCode of + '0'..'9', 'a'..'z', 'A'..'Z', ' ', '-', '_', '!', ',', '<', '/', '*', '?', '''', '"', + '[', '{', ';', ':': begin if Interaction = 0 then begin @@ -53,7 +55,10 @@ begin SetTextFound(CatSongs.SetFilter(Button[0].Text[0].Text, SelectType)); end; end; + end; + // check special keys + case PressedKey of SDLK_BACKSPACE: begin if (Interaction = 0) AND (Length(Button[0].Text[0].Text) > 0) then diff --git a/Game/Code/Screens/UScreenSongMenu.pas b/Game/Code/Screens/UScreenSongMenu.pas index e3ec825e..9cbb1be9 100644 --- a/Game/Code/Screens/UScreenSongMenu.pas +++ b/Game/Code/Screens/UScreenSongMenu.pas @@ -67,17 +67,21 @@ uses UGraphic, function TScreenSongMenu.ParseInput(PressedKey: Cardinal; CharCode: WideChar; PressedDown: Boolean): Boolean; begin Result := true; - If (PressedDown) Then + if (PressedDown) then begin // Key Down - if (CurMenu = SM_Playlist_New) AND (Interaction=0) then + if (CurMenu = SM_Playlist_New) AND (Interaction=0) then
begin - case PressedKey of - SDLK_0..SDLK_9, SDLK_A..SDLK_Z, SDLK_SPACE, SDLK_MINUS, SDLK_EXCLAIM, SDLK_COMMA, SDLK_SLASH, SDLK_ASTERISK, SDLK_QUESTION, SDLK_QUOTE, SDLK_QUOTEDBL: + // check normal keys + case WideUpperCase(CharCode)[1] of + '0'..'9', 'A'..'Z', ' ', '-', '_', '!', ',', '<', '/', '*', '?', '''', '"': begin Button[Interaction].Text[0].Text := Button[Interaction].Text[0].Text + CharCode; exit; end; + end; + // check special keys + case PressedKey of SDLK_BACKSPACE: begin Button[Interaction].Text[0].DeleteLastL; @@ -86,13 +90,17 @@ begin end; end; - case PressedKey of - SDLK_Q: - begin - Result := false; - end; - + // check normal keys + case WideUpperCase(CharCode)[1] of + 'Q': + begin
+ Result := false;
+ Exit;
+ end;
+ end;
+ // check special keys + case PressedKey of SDLK_ESCAPE, SDLK_BACKSPACE : begin @@ -149,10 +157,8 @@ begin end; end; end; - - - end; - end; + end; // case + end; // if end; constructor TScreenSongMenu.Create; diff --git a/Game/Code/Screens/UScreenStatDetail.pas b/Game/Code/Screens/UScreenStatDetail.pas index 08a378ca..14f4808e 100644 --- a/Game/Code/Screens/UScreenStatDetail.pas +++ b/Game/Code/Screens/UScreenStatDetail.pas @@ -44,12 +44,17 @@ begin Result := true;
If (PressedDown) Then
begin // Key Down
- case PressedKey of
- SDLK_Q:
+ // check normal keys
+ case WideUpperCase(CharCode)[1] of
+ 'Q': begin
Result := false;
+ Exit;
end;
-
+ end;
+
+ // check special keys
+ case PressedKey of
SDLK_ESCAPE,
SDLK_BACKSPACE :
begin
diff --git a/Game/Code/Screens/UScreenStatMain.pas b/Game/Code/Screens/UScreenStatMain.pas index f83fa005..87bd1b5f 100644 --- a/Game/Code/Screens/UScreenStatMain.pas +++ b/Game/Code/Screens/UScreenStatMain.pas @@ -52,12 +52,17 @@ begin Result := true; If (PressedDown) Then begin // Key Down + // check normal keys + case WideUpperCase(CharCode)[1] of
+ 'Q': + begin
+ Result := false;
+ Exit;
+ end;
+ end;
+
+ // check special keys
case PressedKey of - SDLK_Q: - begin - Result := false; - end; - SDLK_ESCAPE, SDLK_BACKSPACE : begin diff --git a/Game/Code/Screens/UScreenTop5.pas b/Game/Code/Screens/UScreenTop5.pas index 4c17a437..8ebb056c 100644 --- a/Game/Code/Screens/UScreenTop5.pas +++ b/Game/Code/Screens/UScreenTop5.pas @@ -37,13 +37,17 @@ function TScreenTop5.ParseInput(PressedKey: Cardinal; CharCode: WideChar; Presse begin Result := true; If (PressedDown) Then begin + // check normal keys + case WideUpperCase(CharCode)[1] of
+ 'Q': + begin
+ Result := false;
+ Exit;
+ end;
+ end;
+
+ // check special keys
case PressedKey of - SDLK_Q: - begin - Result := false; - end; - - SDLK_ESCAPE, SDLK_BACKSPACE, SDLK_RETURN: |