no message
This commit is contained in:
		@@ -237,6 +237,10 @@ static struct
 | 
			
		||||
 | 
			
		||||
char getKeyboardText()
 | 
			
		||||
{
 | 
			
		||||
	char text = getSystem()->getKeyboardText();
 | 
			
		||||
 | 
			
		||||
	if(text) return text;
 | 
			
		||||
 | 
			
		||||
	tic_mem* tic = impl.studio.tic;
 | 
			
		||||
 | 
			
		||||
	static const char Symbols[] = 	" abcdefghijklmnopqrstuvwxyz0123456789-=[]\\;'`,./ ";
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										19
									
								
								src/system.c
									
									
									
									
									
								
							
							
						
						
									
										19
									
								
								src/system.c
									
									
									
									
									
								
							@@ -65,6 +65,7 @@ static struct
 | 
			
		||||
			GPU_Image* down;
 | 
			
		||||
		} texture;
 | 
			
		||||
 | 
			
		||||
		char text;
 | 
			
		||||
	} keyboard;
 | 
			
		||||
 | 
			
		||||
	u32 touchCounter;
 | 
			
		||||
@@ -394,6 +395,15 @@ static void processMouse()
 | 
			
		||||
	}
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
// TODO: ugly hack, but I didn't find a better solution
 | 
			
		||||
// will try to fix it later
 | 
			
		||||
static char getKeyboardText()
 | 
			
		||||
{
 | 
			
		||||
	char text = platform.keyboard.text;
 | 
			
		||||
	platform.keyboard.text = 0;
 | 
			
		||||
	return text;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
static void processKeyboard()
 | 
			
		||||
{
 | 
			
		||||
	static const u8 KeyboardCodes[] = 
 | 
			
		||||
@@ -785,6 +795,14 @@ static void pollEvent()
 | 
			
		||||
			case SDL_WINDOWEVENT_FOCUS_GAINED: platform.studio->updateProject(); break;
 | 
			
		||||
			}
 | 
			
		||||
			break;
 | 
			
		||||
		case SDL_TEXTINPUT:
 | 
			
		||||
			{
 | 
			
		||||
				const char* text = event.text.text;
 | 
			
		||||
 | 
			
		||||
				if(strlen(text) == 1)
 | 
			
		||||
					platform.keyboard.text = *text;
 | 
			
		||||
			}
 | 
			
		||||
			break;
 | 
			
		||||
		case SDL_QUIT:
 | 
			
		||||
			platform.studio->exit();
 | 
			
		||||
			break;
 | 
			
		||||
@@ -1278,6 +1296,7 @@ static System systemInterface =
 | 
			
		||||
	.preseed = preseed,
 | 
			
		||||
	.poll = pollEvent,
 | 
			
		||||
	.updateConfig = updateConfig,
 | 
			
		||||
	.getKeyboardText = getKeyboardText,
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
static void gpuTick()
 | 
			
		||||
 
 | 
			
		||||
@@ -29,6 +29,8 @@ typedef struct
 | 
			
		||||
 | 
			
		||||
	void (*updateConfig)();
 | 
			
		||||
 | 
			
		||||
	char (*getKeyboardText)();
 | 
			
		||||
 | 
			
		||||
} System;
 | 
			
		||||
 | 
			
		||||
typedef struct
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user