Skip to content
This repository has been archived by the owner on Feb 11, 2021. It is now read-only.

Commit

Permalink
Changed StartTextInput to take an SDL_Window parameter.
Browse files Browse the repository at this point in the history
  • Loading branch information
dewyatt committed Jul 8, 2010
1 parent 91645b5 commit cbd5b5b
Show file tree
Hide file tree
Showing 8 changed files with 9 additions and 10 deletions.
2 changes: 1 addition & 1 deletion include/SDL_keyboard.h
Expand Up @@ -140,7 +140,7 @@ extern DECLSPEC const char *SDLCALL SDL_GetKeyName(SDLKey key);
* \sa SDL_StopTextInput()
* \sa SDL_SetTextInputRect()
*/
extern DECLSPEC void SDLCALL SDL_StartTextInput(void);
extern DECLSPEC void SDLCALL SDL_StartTextInput(SDL_Window *window);

/**
* \brief Stop receiving any text input events.
Expand Down
2 changes: 1 addition & 1 deletion src/SDL_compat.c
Expand Up @@ -1740,7 +1740,7 @@ SDL_EnableUNICODE(int enable)
switch (enable) {
case 1:
SDL_enabled_UNICODE = 1;
SDL_StartTextInput();
SDL_StartTextInput(SDL_VideoWindow);
break;
case 0:
SDL_enabled_UNICODE = 0;
Expand Down
2 changes: 1 addition & 1 deletion src/events/SDL_keyboard.c
Expand Up @@ -617,7 +617,7 @@ SDL_SetKeyboardFocus(SDL_Window * window)
0, 0);

if (SDL_EventState(SDL_TEXTINPUT, SDL_QUERY)) {
SDL_StartTextInput();
SDL_StartTextInput(window);
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/video/SDL_sysvideo.h
Expand Up @@ -299,7 +299,7 @@ struct SDL_VideoDevice
void (*SuspendScreenSaver) (_THIS);

/* Text input */
void (*StartTextInput) (_THIS);
void (*StartTextInput) (_THIS, SDL_Window *window);
void (*StopTextInput) (_THIS);
void (*SetTextInputRect) (_THIS, SDL_Rect *rect);

Expand Down
4 changes: 2 additions & 2 deletions src/video/SDL_video.c
Expand Up @@ -3385,10 +3385,10 @@ SDL_GetWindowWMInfo(SDL_Window * window, struct SDL_SysWMinfo *info)
}

void
SDL_StartTextInput(void)
SDL_StartTextInput(SDL_Window *window)
{
if (_this && _this->StartTextInput) {
_this->StartTextInput(_this);
_this->StartTextInput(_this, window);
}
SDL_EventState(SDL_TEXTINPUT, SDL_ENABLE);
SDL_EventState(SDL_TEXTEDITING, SDL_ENABLE);
Expand Down
3 changes: 1 addition & 2 deletions src/video/win32/SDL_win32keyboard.c
Expand Up @@ -123,9 +123,8 @@ WIN_QuitKeyboard(_THIS)
}

void
WIN_StartTextInput(_THIS)
WIN_StartTextInput(_THIS, SDL_Window *window)
{
SDL_Window *window = SDL_GetKeyboardFocus();
HWND hwnd = ((SDL_WindowData *) window->driverdata)->hwnd;

}
Expand Down
2 changes: 1 addition & 1 deletion src/video/win32/SDL_win32keyboard.h
Expand Up @@ -31,7 +31,7 @@ extern void WIN_InitKeyboard(_THIS);
extern void WIN_UpdateKeymap(void);
extern void WIN_QuitKeyboard(_THIS);

extern void WIN_StartTextInput(_THIS);
extern void WIN_StartTextInput(_THIS, SDL_Window *window);
extern void WIN_StopTextInput(_THIS);
extern void WIN_SetTextInputRect(_THIS, SDL_Rect *rect);

Expand Down
2 changes: 1 addition & 1 deletion src/video/win32/SDL_win32video.c
Expand Up @@ -163,7 +163,7 @@ WIN_CreateDevice(int devindex)
device->GL_DeleteContext = WIN_GL_DeleteContext;
#endif
device->StartTextInput = WIN_StartTextInput;
device->StopTextInput = WIN_StartTextInput;
device->StopTextInput = WIN_StopTextInput;
device->SetTextInputRect = WIN_SetTextInputRect;

device->free = WIN_DeleteDevice;
Expand Down

0 comments on commit cbd5b5b

Please sign in to comment.