shithub: ft²

Download patch

ref: 8ccf7af5f41042323a35fee11f29748fb02e8e1c
parent: 4e9dd5ea4261a6adfd0b675d65ecabc89339ec01
author: qwx <qwx@sciops.net>
date: Sun Mar 5 18:07:32 EST 2023

keyboard: tweak, add volume up/down media keys for master volume

--- a/src/ft2_keyboard.c
+++ b/src/ft2_keyboard.c
@@ -346,6 +346,27 @@
 		}
 		return;
 
+		case SDL_SCANCODE_VOLUMEUP:
+			if (config.masterVol <= 256-16)
+				config.masterVol += 16;
+			else
+				config.masterVol = 256;
+
+			setAudioAmp(config.boostLevel, config.masterVol, !!(config.specialFlags & BITDEPTH_32));
+			if (ui.configScreenShown && editor.currConfigScreen == CONFIG_SCREEN_IO_DEVICES)
+				showConfigScreen();
+			break;
+		case SDL_SCANCODE_VOLUMEDOWN:
+			if (config.masterVol >= 16)
+				config.masterVol -= 16;
+			else
+				config.masterVol = 0;
+
+			setAudioAmp(config.boostLevel, config.masterVol, !!(config.specialFlags & BITDEPTH_32));
+			if (ui.configScreenShown && editor.currConfigScreen == CONFIG_SCREEN_IO_DEVICES)
+				showConfigScreen();
+			break;
+
 		default: break;
 	}