Changeset - r7310:5e788d82877a
[Not reviewed]
master
0 5 0
truelight - 17 years ago 2007-07-23 16:39:27
truelight@openttd.org
(svn r10662) -Add: added 'V' as new shortcut for new viewport (bilbo)
-Add: added 'M' as new shortcut for smallmap (bilbo)
-Add: added '+' and '-' as shortcuts to zoom in the mainview (bilbo)
-Add: added support for other keycodes to be possible used in the future (bilbo)
5 files changed with 67 insertions and 3 deletions:
0 comments (0 inline, 0 general)
src/gfx.h
Show inline comments
 
@@ -80,6 +80,21 @@ enum WindowKeyCodes {
 
	/* 0-9 are mapped to 48-57
 
	 * A-Z are mapped to 65-90
 
	 * a-z are mapped to 97-122 */
 

	
 
	/* Other keys, corresponding to their ascii values */
 
	WKC_SLASH       = 47, // / Forward slash
 
	WKC_SEMICOLON   = 59, // ; Semicolon
 
	WKC_EQUALS      = 61, // = Equals
 
	WKC_L_BRACKET   = 91, // [ Left square bracket
 
	WKC_BACKSLASH   = 92, // \ Backslash
 
	WKC_R_BRACKET   = 93, // ] Right square bracket
 

	
 
	/* Other keys of which their ascii value is already taken
 
	 * - use unused ascii value not present on keyboard directly */
 
	WKC_SINGLEQUOTE = 58, // ' Single quote
 
	WKC_COMMA       = 60, // , Comma
 
	WKC_PERIOD      = 62, // . Period
 
	WKC_MINUS       = 95, // - Minus
 
};
 

	
 
enum GameModes {
src/main_gui.cpp
Show inline comments
 
@@ -1649,7 +1649,13 @@ static void MainToolbarWndProc(Window *w
 
		case WKC_SHIFT | WKC_F2: ShowVehicleListWindow(_local_player, VEH_ROAD); break;
 
		case WKC_SHIFT | WKC_F3: ShowVehicleListWindow(_local_player, VEH_SHIP); break;
 
		case WKC_SHIFT | WKC_F4: ShowVehicleListWindow(_local_player, VEH_AIRCRAFT); break;
 
		case WKC_NUM_PLUS: /* Fall through */
 
		case WKC_EQUALS: /* Fall through */
 
		case WKC_SHIFT | WKC_EQUALS: /* Fall through */
 
		case WKC_SHIFT | WKC_F5: ToolbarZoomInClick(w); break;
 
		case WKC_NUM_MINUS: /* Fall through */
 
		case WKC_MINUS: /* Fall through */
 
		case WKC_SHIFT | WKC_MINUS: /* Fall through */
 
		case WKC_SHIFT | WKC_F6: ToolbarZoomOutClick(w); break;
 
		case WKC_SHIFT | WKC_F7: if (CanBuildVehicleInfrastructure(VEH_TRAIN)) ShowBuildRailToolbar(_last_built_railtype, -1); break;
 
		case WKC_SHIFT | WKC_F8: ShowBuildRoadToolbar(_last_built_roadtype); break;
 
@@ -1662,6 +1668,8 @@ static void MainToolbarWndProc(Window *w
 
		case WKC_CTRL | WKC_ALT | 'C': if (!_networking) ShowCheatWindow(); break;
 
		case 'A': if (CanBuildVehicleInfrastructure(VEH_TRAIN)) ShowBuildRailToolbar(_last_built_railtype, 4); break; /* Invoke Autorail */
 
		case 'L': ShowTerraformToolbar(); break;
 
		case 'M': ShowSmallMap(); break;
 
		case 'V': ShowExtraViewPortWindow(); break;
 
		default: return;
 
		}
 
		e->we.keypress.cont = false;
src/video/cocoa_v.mm
Show inline comments
 
@@ -330,7 +330,21 @@ static const VkMapping _vk_mapping[] = {
 
	AS(QZ_KP_MINUS,    WKC_NUM_MINUS),
 
	AS(QZ_KP_PLUS,     WKC_NUM_PLUS),
 
	AS(QZ_KP_ENTER,    WKC_NUM_ENTER),
 
	AS(QZ_KP_PERIOD,   WKC_NUM_DECIMAL)
 
	AS(QZ_KP_PERIOD,   WKC_NUM_DECIMAL),
 

	
 
	// Other non-letter keys
 
	AS(QZ_SLASH,        WKC_SLASH),
 
	AS(QZ_SEMICOLON,    WKC_SEMICOLON),
 
	AS(QZ_EQUALS,       WKC_EQUALS),
 
	AS(QZ_LEFTBRACKET,  WKC_L_BRACKET),
 
	AS(QZ_BACKSLASH,    WKC_BACKSLASH),
 
	AS(QZ_RIGHTBRACKET, WKC_R_BRACKET),
 

	
 
	AS(QZ_QUOTE,   WKC_SINGLEQUOTE),
 
	AS(QZ_COMMA,   WKC_COMMA),
 
	AS(QZ_MINUS,   WKC_MINUS),
 
	AS(QZ_PERIOD,  WKC_PERIOD)
 

	
 
};
 

	
 

	
src/video/sdl_v.cpp
Show inline comments
 
@@ -276,7 +276,21 @@ static const VkMapping _vk_mapping[] = {
 
	AS(SDLK_KP_MINUS,    WKC_NUM_MINUS),
 
	AS(SDLK_KP_PLUS,     WKC_NUM_PLUS),
 
	AS(SDLK_KP_ENTER,    WKC_NUM_ENTER),
 
	AS(SDLK_KP_PERIOD,   WKC_NUM_DECIMAL)
 
	AS(SDLK_KP_PERIOD,   WKC_NUM_DECIMAL),
 

	
 
	// Other non-letter keys
 
	AS(SDLK_SLASH,        WKC_SLASH),
 
	AS(SDLK_SEMICOLON,    WKC_SEMICOLON),
 
	AS(SDLK_EQUALS,       WKC_EQUALS),
 
	AS(SDLK_LEFTBRACKET,  WKC_L_BRACKET),
 
	AS(SDLK_BACKSLASH,    WKC_BACKSLASH),
 
	AS(SDLK_RIGHTBRACKET, WKC_R_BRACKET),
 

	
 
	AS(SDLK_QUOTE,   WKC_SINGLEQUOTE),
 
	AS(SDLK_COMMA,   WKC_COMMA),
 
	AS(SDLK_MINUS,   WKC_MINUS),
 
	AS(SDLK_PERIOD,  WKC_PERIOD)
 

	
 
};
 

	
 
static uint32 ConvertSdlKeyIntoMy(SDL_keysym *sym)
src/video/win32_v.cpp
Show inline comments
 
@@ -108,7 +108,20 @@ static const VkMapping _vk_mapping[] = {
 
	AS(VK_MULTIPLY, WKC_NUM_MUL),
 
	AS(VK_SUBTRACT, WKC_NUM_MINUS),
 
	AS(VK_ADD,      WKC_NUM_PLUS),
 
	AS(VK_DECIMAL,  WKC_NUM_DECIMAL)
 
	AS(VK_DECIMAL,  WKC_NUM_DECIMAL),
 

	
 
	// Other non-letter keys
 
	AS(0xBF,  WKC_SLASH),
 
	AS(0xBA,  WKC_SEMICOLON),
 
	AS(0xBB,  WKC_EQUALS),
 
	AS(0xDB,  WKC_L_BRACKET),
 
	AS(0xDC,  WKC_BACKSLASH),
 
	AS(0xDD,  WKC_R_BRACKET),
 

	
 
	AS(0xDE,  WKC_SINGLEQUOTE),
 
	AS(0xBC,  WKC_COMMA),
 
	AS(0xBD,  WKC_MINUS),
 
	AS(0xBE,  WKC_PERIOD)
 
};
 

	
 
static uint MapWindowsKey(uint sym)
0 comments (0 inline, 0 general)