shithub: ft²

Download patch

ref: f58f8d3d980f2a97a573aab698e8729f7fc631d3
parent: 8898df42f669d4140fa5404e615bf048356437f6
author: Olav Sørensen <[email protected]>
date: Tue Feb 2 13:39:32 EST 2021

Fix: Key next to left shift (Note Off) was not working on all kb layouts

--- a/src/ft2_edit.c
+++ b/src/ft2_edit.c
@@ -47,6 +47,27 @@
 static bool testNoteKeys(SDL_Scancode scancode)
 {
 	const int8_t noteNum = scancodeKeyToNote(scancode);
+	if (noteNum == 97)
+	{
+		// inserts "note off" if editing song
+		if (playMode == PLAYMODE_EDIT || playMode == PLAYMODE_RECPATT || playMode == PLAYMODE_RECSONG)
+		{
+			if (!allocatePattern(editor.editPattern))
+				return true; // key pressed
+
+			patt[editor.editPattern][(editor.pattPos * MAX_VOICES) + cursor.ch].ton = 97;
+
+			const uint16_t pattLen = pattLens[editor.editPattern];
+			if (playMode == PLAYMODE_EDIT && pattLen >= 1)
+				setPos(-1, (editor.pattPos + editor.ID_Add) % pattLen, true);
+
+			ui.updatePatternEditor = true;
+			setSongModifiedFlag();
+		}
+
+		return true; // key pressed
+	}
+
 	if (noteNum > 0 && noteNum <= 96)
 	{
 		recordNote(noteNum, -1);
--- a/src/ft2_header.h
+++ b/src/ft2_header.h
@@ -12,7 +12,7 @@
 #endif
 #include "ft2_replayer.h"
 
-#define PROG_VER_STR "1.43"
+#define PROG_VER_STR "1.44"
 
 // do NOT change these! It will only mess things up...
 
--- a/src/ft2_keyboard.c
+++ b/src/ft2_keyboard.c
@@ -331,27 +331,6 @@
 		}
 		break;
 
-		// note off
-		case SDLK_LESS:
-		case SDLK_CAPSLOCK:
-		{
-			if (playMode == PLAYMODE_EDIT || playMode == PLAYMODE_RECPATT || playMode == PLAYMODE_RECSONG)
-			{
-				if (!allocatePattern(editor.editPattern))
-					break;
-
-				patt[editor.editPattern][(editor.pattPos * MAX_VOICES) + cursor.ch].ton = 97;
-
-				const uint16_t pattLen = pattLens[editor.editPattern];
-				if (playMode == PLAYMODE_EDIT && pattLen >= 1)
-					setPos(-1, (editor.pattPos + editor.ID_Add) % pattLen, true);
-
-				ui.updatePatternEditor = true;
-				setSongModifiedFlag();
-			}
-		}
-		break;
-
 		// This is maybe not an ideal key for this anymore...
 		//case SDLK_PRINTSCREEN: togglePatternEditorExtended(); break;