21 #include "../../SDL_internal.h" 23 #if SDL_VIDEO_DRIVER_WINRT 35 #include "../../events/scancodes_windows.h" 36 #include "../../events/SDL_keyboard_c.h" 219 WINRT_TranslateUnofficialKeycode(
int keycode)
255 WINRT_TranslateKeycode(
int keycode,
unsigned int nativeScancode)
298 scancode = WinRT_Official_Keycodes[keycode];
301 scancode = WINRT_TranslateUnofficialKeycode(keycode);
317 WINRT_ProcessKeyDownEvent(Windows::UI::Core::KeyEventArgs ^args)
319 SDL_Scancode sdlScancode = WINRT_TranslateKeycode((
int)args->VirtualKey, args->KeyStatus.ScanCode);
322 SDL_Log(
"key down, handled=%s, ext?=%s, released?=%s, menu key down?=%s, " 323 "repeat count=%d, native scan code=0x%x, was down?=%s, vkey=%d, " 324 "sdl scan code=%d (%s), sdl key code=%d (%s)\n",
325 (args->Handled ?
"1" :
"0"),
326 (args->KeyStatus.IsExtendedKey ?
"1" :
"0"),
327 (args->KeyStatus.IsKeyReleased ?
"1" :
"0"),
328 (args->KeyStatus.IsMenuKeyDown ?
"1" :
"0"),
329 args->KeyStatus.RepeatCount,
330 args->KeyStatus.ScanCode,
331 (args->KeyStatus.WasKeyDown ?
"1" :
"0"),
343 WINRT_ProcessKeyUpEvent(Windows::UI::Core::KeyEventArgs ^args)
345 SDL_Scancode sdlScancode = WINRT_TranslateKeycode((
int)args->VirtualKey, args->KeyStatus.ScanCode);
348 SDL_Log(
"key up, handled=%s, ext?=%s, released?=%s, menu key down?=%s, " 349 "repeat count=%d, native scan code=0x%x, was down?=%s, vkey=%d, " 350 "sdl scan code=%d (%s), sdl key code=%d (%s)\n",
351 (args->Handled ?
"1" :
"0"),
352 (args->KeyStatus.IsExtendedKey ?
"1" :
"0"),
353 (args->KeyStatus.IsKeyReleased ?
"1" :
"0"),
354 (args->KeyStatus.IsMenuKeyDown ?
"1" :
"0"),
355 args->KeyStatus.RepeatCount,
356 args->KeyStatus.ScanCode,
357 (args->KeyStatus.WasKeyDown ?
"1" :
"0"),
369 WINRT_ProcessCharacterReceivedEvent(Windows::UI::Core::CharacterReceivedEventArgs ^args)
376 src_ucs2[0] = args->KeyCode;
380 result = WideCharToMultiByte(CP_UTF8, 0, (LPCWSTR)&src_ucs2, -1, (LPSTR)dest_utf8,
sizeof(dest_utf8),
NULL,
NULL);
387 #if NTDDI_VERSION >= NTDDI_WIN10 396 using namespace Windows::UI::ViewManagement;
397 InputPane ^ inputPane = InputPane::GetForCurrentView();
399 inputPane->TryShow();
405 using namespace Windows::UI::ViewManagement;
406 InputPane ^ inputPane = InputPane::GetForCurrentView();
408 inputPane->TryHide();
414 using namespace Windows::UI::ViewManagement;
415 InputPane ^ inputPane = InputPane::GetForCurrentView();
420 Windows::Foundation::Rect
rect = inputPane->OccludedRect;
421 if (rect.Width > 0 && rect.Height > 0) {
428 #endif // NTDDI_VERSION >= ... 430 #endif // SDL_VIDEO_DRIVER_WINRT
#define SDL_GetKeyFromScancode
Sint32 SDL_Keycode
The SDL virtual key representation.
int SDL_SendKeyboardKey(Uint8 state, SDL_Scancode scancode)
int SDL_SendKeyboardText(const char *text)
#define SDL_GetScancodeName
EGLSurface EGLNativeWindowType * window
static const SDL_Scancode windows_scancode_table[]
The type used to identify a window.
#define SDL_arraysize(array)
SDL_Scancode
The SDL keyboard scancode representation.