Browse Source

Add letter keys to control color levels

For keyboards without numpad.
DricomDragon 4 years ago
parent
commit
50be15d9f8
1 changed files with 24 additions and 0 deletions
  1. 24 0
      sdl1/colorGenerator/main.cpp

+ 24 - 0
sdl1/colorGenerator/main.cpp

@@ -60,27 +60,39 @@ int main ( int argc, char** argv )
 						case SDLK_ESCAPE:
 							done = true;
 							break;
+						case SDLK_a:
 						case SDLK_KP7:
+						case SDLK_7:
 							ubr = true;
 							dbr = false;
 							break;
+						case SDLK_q:
 						case SDLK_KP1:
+						case SDLK_1:
 							ubr = false;
 							dbr = true;
 							break;
+						case SDLK_z:
 						case SDLK_KP8:
+						case SDLK_8:
 							ubg = true;
 							dbg = false;
 							break;
+						case SDLK_s:
 						case SDLK_KP2:
+						case SDLK_2:
 							ubg = false;
 							dbg = true;
 							break;
+						case SDLK_e:
 						case SDLK_KP9:
+						case SDLK_9:
 							ubb = true;
 							dbb = false;
 							break;
+						case SDLK_d:
 						case SDLK_KP3:
+						case SDLK_3:
 							ubb = false;
 							dbb = true;
 							break;
@@ -92,27 +104,39 @@ int main ( int argc, char** argv )
 				case SDL_KEYUP:
 					switch ( event.key.keysym.sym )
 					{
+						case SDLK_a:
 						case SDLK_KP7:
+						case SDLK_7:
 							ubr = false;
 							dbr = false;
 							break;
+						case SDLK_q:
 						case SDLK_KP1:
+						case SDLK_1:
 							ubr = false;
 							dbr = false;
 							break;
+						case SDLK_z:
 						case SDLK_KP8:
+						case SDLK_8:
 							ubg = false;
 							dbg = false;
 							break;
+						case SDLK_s:
 						case SDLK_KP2:
+						case SDLK_2:
 							ubg = false;
 							dbg = false;
 							break;
+						case SDLK_e:
 						case SDLK_KP9:
+						case SDLK_9:
 							ubb = false;
 							dbb = false;
 							break;
+						case SDLK_d:
 						case SDLK_KP3:
+						case SDLK_3:
 							ubb = false;
 							dbb = false;
 							break;