Mercurial > sdl-ios-xcode
comparison src/video/win32/SDL_win32keyboard.c @ 4753:11b0a6a3eb4d
Changed Start/StopTextInput back to not take any parameters.
We call SDL_GetKeyboardFocus internally now.
author | dewyatt |
---|---|
date | Mon, 12 Jul 2010 14:17:43 -0400 |
parents | dc7bdcf06367 |
children | 863ba7d1f029 |
comparison
equal
deleted
inserted
replaced
4752:dc7bdcf06367 | 4753:11b0a6a3eb4d |
---|---|
139 { | 139 { |
140 IME_Quit((SDL_VideoData *)_this->driverdata); | 140 IME_Quit((SDL_VideoData *)_this->driverdata); |
141 } | 141 } |
142 | 142 |
143 void | 143 void |
144 WIN_StartTextInput(_THIS, SDL_Window *window) | 144 WIN_StartTextInput(_THIS) |
145 { | 145 { |
146 HWND hwnd = ((SDL_WindowData *) window->driverdata)->hwnd; | 146 SDL_Window *window = SDL_GetKeyboardFocus(); |
147 SDL_VideoData *videodata = (SDL_VideoData *)_this->driverdata; | 147 if (window) |
148 IME_Init(videodata, hwnd); | 148 { |
149 IME_Enable(videodata, hwnd); | 149 HWND hwnd = ((SDL_WindowData *) window->driverdata)->hwnd; |
150 } | 150 SDL_VideoData *videodata = (SDL_VideoData *)_this->driverdata; |
151 | 151 IME_Init(videodata, hwnd); |
152 void | 152 IME_Enable(videodata, hwnd); |
153 WIN_StopTextInput(_THIS, SDL_Window *window) | 153 } |
154 { | 154 } |
155 HWND hwnd = ((SDL_WindowData *) window->driverdata)->hwnd; | 155 |
156 SDL_VideoData *videodata = (SDL_VideoData *)_this->driverdata; | 156 void |
157 IME_Init(videodata, hwnd); | 157 WIN_StopTextInput(_THIS) |
158 IME_Disable(videodata, hwnd); | 158 { |
159 SDL_Window *window = SDL_GetKeyboardFocus(); | |
160 if (window) | |
161 { | |
162 HWND hwnd = ((SDL_WindowData *) window->driverdata)->hwnd; | |
163 SDL_VideoData *videodata = (SDL_VideoData *)_this->driverdata; | |
164 IME_Init(videodata, hwnd); | |
165 IME_Disable(videodata, hwnd); | |
166 } | |
159 } | 167 } |
160 | 168 |
161 void | 169 void |
162 WIN_SetTextInputRect(_THIS, SDL_Rect *rect) | 170 WIN_SetTextInputRect(_THIS, SDL_Rect *rect) |
163 { | 171 { |