From 2f13bd60b64a1c5e101cb00f68a7863fb1409dd6 Mon Sep 17 00:00:00 2001 From: Persune Date: Wed, 29 Nov 2023 22:18:39 +0800 Subject: [PATCH] Fix numpad effect number input Fixes #48. --- Source/FamiTrackerView.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/Source/FamiTrackerView.cpp b/Source/FamiTrackerView.cpp index f12c6697..7b61e31b 100644 --- a/Source/FamiTrackerView.cpp +++ b/Source/FamiTrackerView.cpp @@ -2973,9 +2973,6 @@ bool CFamiTrackerView::EditEffNumberColumn(stChanNote &Note, Input input, int Ef bStepDown = true; return true; } - - if (key >= VK_NUMPAD0 && key <= VK_NUMPAD9) - key = '0' + (key - VK_NUMPAD0); } CFamiTrackerDoc* pDoc = GetDocument(); @@ -2990,6 +2987,10 @@ bool CFamiTrackerView::EditEffNumberColumn(stChanNote &Note, Input input, int Ef if (auto p = get_if(&input)) { auto key = *p; + + if (key >= VK_NUMPAD0 && key <= VK_NUMPAD9) + key = '0' + (key - VK_NUMPAD0); + if (!isAlphanumeric(key)) { return false; }