mirror of
https://github.com/libsdl-org/SDL.git
synced 2026-04-24 16:25:49 +00:00
WinRT: added initial SDL_TEXTINPUT support
Further support regarding IME and on-screen keyboards is pending, some of which might not be 100% compatible with other platforms, given WinRT platform restrictions. An MSDN article at http://msdn.microsoft.com/en-us/library/windows/apps/hh465404.aspx indicates that on-screen keyboard display requires that the user first tap on a Windows/XAML text control. This change adds basic SDL_TEXTINPUT support, with input coming from hardware keyboards, at a minimum, and without the need for XAML integration (which is still pending integration into SDL, by and large).
This commit is contained in:
@@ -365,6 +365,9 @@ void SDL_WinRTApp::SetWindow(CoreWindow^ window)
|
||||
window->KeyUp +=
|
||||
ref new TypedEventHandler<CoreWindow^, KeyEventArgs^>(this, &SDL_WinRTApp::OnKeyUp);
|
||||
|
||||
window->CharacterReceived +=
|
||||
ref new TypedEventHandler<CoreWindow^, CharacterReceivedEventArgs^>(this, &SDL_WinRTApp::OnCharacterReceived);
|
||||
|
||||
#if WINAPI_FAMILY == WINAPI_FAMILY_PHONE_APP
|
||||
HardwareButtons::BackPressed +=
|
||||
ref new EventHandler<BackPressedEventArgs^>(this, &SDL_WinRTApp::OnBackButtonPressed);
|
||||
@@ -703,6 +706,11 @@ void SDL_WinRTApp::OnKeyUp(Windows::UI::Core::CoreWindow^ sender, Windows::UI::C
|
||||
WINRT_ProcessKeyUpEvent(args);
|
||||
}
|
||||
|
||||
void SDL_WinRTApp::OnCharacterReceived(Windows::UI::Core::CoreWindow^ sender, Windows::UI::Core::CharacterReceivedEventArgs^ args)
|
||||
{
|
||||
WINRT_ProcessCharacterReceivedEvent(args);
|
||||
}
|
||||
|
||||
#if WINAPI_FAMILY == WINAPI_FAMILY_PHONE_APP
|
||||
void SDL_WinRTApp::OnBackButtonPressed(Platform::Object^ sender, Windows::Phone::UI::Input::BackPressedEventArgs^ args)
|
||||
{
|
||||
|
||||
@@ -69,6 +69,7 @@ protected:
|
||||
void OnMouseMoved(Windows::Devices::Input::MouseDevice^ mouseDevice, Windows::Devices::Input::MouseEventArgs^ args);
|
||||
void OnKeyDown(Windows::UI::Core::CoreWindow^ sender, Windows::UI::Core::KeyEventArgs^ args);
|
||||
void OnKeyUp(Windows::UI::Core::CoreWindow^ sender, Windows::UI::Core::KeyEventArgs^ args);
|
||||
void OnCharacterReceived(Windows::UI::Core::CoreWindow^ sender, Windows::UI::Core::CharacterReceivedEventArgs^ args);
|
||||
|
||||
#if WINAPI_FAMILY == WINAPI_FAMILY_PHONE_APP
|
||||
void OnBackButtonPressed(Platform::Object^ sender, Windows::Phone::UI::Input::BackPressedEventArgs^ args);
|
||||
|
||||
Reference in New Issue
Block a user