mirror of
https://github.com/alexbatalov/fallout2-ce.git
synced 2024-09-04 13:59:04 +00:00
Add mobile keyboard support (#206)
This commit is contained in:
parent
4b03c714b4
commit
c383fc6b95
@ -1931,6 +1931,8 @@ static int _get_input_str(int win, int cancelKeyCode, char* text, int maxLength,
|
||||
|
||||
windowRefresh(win);
|
||||
|
||||
beginTextInput();
|
||||
|
||||
int blinkingCounter = 3;
|
||||
bool blink = false;
|
||||
|
||||
@ -1994,6 +1996,8 @@ static int _get_input_str(int win, int cancelKeyCode, char* text, int maxLength,
|
||||
sharedFpsLimiter.throttle();
|
||||
}
|
||||
|
||||
endTextInput();
|
||||
|
||||
if (rc == 0 || nameLength > 0) {
|
||||
copy[nameLength] = '\0';
|
||||
strcpy(text, copy);
|
||||
|
@ -1089,6 +1089,8 @@ int showSaveFileDialog(char* title, char** fileList, char* dest, int fileListLen
|
||||
|
||||
windowRefresh(win);
|
||||
|
||||
beginTextInput();
|
||||
|
||||
int blinkingCounter = 3;
|
||||
bool blink = false;
|
||||
|
||||
@ -1353,6 +1355,8 @@ int showSaveFileDialog(char* title, char** fileList, char* dest, int fileListLen
|
||||
sharedFpsLimiter.throttle();
|
||||
}
|
||||
|
||||
endTextInput();
|
||||
|
||||
if (rc == 0) {
|
||||
if (fileNameCopyLength != 0) {
|
||||
fileNameCopy[fileNameCopyLength] = '\0';
|
||||
|
10
src/input.cc
10
src/input.cc
@ -1209,4 +1209,14 @@ static void idleImpl()
|
||||
SDL_Delay(125);
|
||||
}
|
||||
|
||||
void beginTextInput()
|
||||
{
|
||||
SDL_StartTextInput();
|
||||
}
|
||||
|
||||
void endTextInput()
|
||||
{
|
||||
SDL_StopTextInput();
|
||||
}
|
||||
|
||||
} // namespace fallout
|
||||
|
@ -44,6 +44,9 @@ void _GNW95_process_message();
|
||||
void _GNW95_clear_time_stamps();
|
||||
void _GNW95_lost_focus();
|
||||
|
||||
void beginTextInput();
|
||||
void endTextInput();
|
||||
|
||||
} // namespace fallout
|
||||
|
||||
#endif /* FALLOUT_INPUT_H_ */
|
||||
|
@ -2213,6 +2213,8 @@ static int _get_input_str2(int win, int doneKeyCode, int cancelKeyCode, char* de
|
||||
windowRefresh(win);
|
||||
renderPresent();
|
||||
|
||||
beginTextInput();
|
||||
|
||||
int blinkCounter = 3;
|
||||
bool blink = false;
|
||||
|
||||
@ -2282,6 +2284,8 @@ static int _get_input_str2(int win, int doneKeyCode, int cancelKeyCode, char* de
|
||||
sharedFpsLimiter.throttle();
|
||||
}
|
||||
|
||||
endTextInput();
|
||||
|
||||
if (rc == 0) {
|
||||
text[textLength] = '\0';
|
||||
strcpy(description, text);
|
||||
|
Loading…
Reference in New Issue
Block a user