Added handling of Ctrl+number keys to Windows front-end.

ver1_6_1
Chris Laurel 2008-10-05 01:11:42 +00:00
parent 829319c06f
commit c906be2af4
2 changed files with 21 additions and 2 deletions

View File

@ -1835,7 +1835,8 @@ void CelestiaCore::charEntered(const char *c_p, int modifiers)
case '8':
case '9':
addToHistory();
sim->selectPlanet(c - '1');
if (!(modifiers & ControlKey))
sim->selectPlanet(c - '1');
break;
case ';':

View File

@ -2062,6 +2062,8 @@ void handleKey(WPARAM key, bool down)
if (GetKeyState(VK_SHIFT) & 0x8000)
modifiers |= CelestiaCore::ShiftKey;
if (GetKeyState(VK_CONTROL) & 0x8000)
modifiers |= CelestiaCore::ControlKey;
switch (key)
{
@ -2151,6 +2153,23 @@ void handleKey(WPARAM key, bool down)
if (!down)
appCore->charEntered('\177');
break;
case '0':
case '1':
case '2':
case '3':
case '4':
case '5':
case '6':
case '7':
case '8':
case '9':
// Special handling required to send Ctrl+number keys to
// Celestia keyboard handler.
if (!down && (modifiers & CelestiaCore::ControlKey))
appCore->charEntered((char) key, modifiers);
break;
case 'A':
case 'Z':
if ((GetKeyState(VK_CONTROL) & 0x8000) == 0)
@ -3779,7 +3798,6 @@ LRESULT CALLBACK MainWindowProc(HWND hWnd,
appCore->flash(_("Copied URL"));
}
break;
default:
handleKey(wParam, true);
break;