Ejemplo n.º 1
0
static void vncServerCallback(GuiElement_t * elem, bool pressed, int x, int y)
{
	if( toggleElement(elem, pressed) )
	{
		if( vncServerRunning() )
		{
			elem->text[0] = "VNC server stopped";
			elem->text[1] = "Touch to start";
			vncServerStop();
			remove(VNC_SERVER_START_AT_BOOT);
		}
		else
		{
			elem->text[0] = "VNC server started on";
			elem->text[1] = vncServerGetIpAddress();
			vncServerStart();
			FILE *ff = fopen(VNC_SERVER_START_AT_BOOT, "w");
			if(ff)
			{
				fprintf(ff, "%s", VNC_SERVER_START_AT_BOOT);
				fclose(ff);
			}
		}
	}
	//GuiElement_t::defaultInputCallback(elem, pressed, x, y);
}
Ejemplo n.º 2
0
static void keyboardToggleCallback(GuiElement_t * elem, bool pressed, int x, int y)
{
#ifdef __ANDROID__
	if( toggleElement(elem, pressed) )
		SDL_ANDROID_ToggleScreenKeyboardWithoutTextInput();
#endif
	GuiElement_t::defaultInputCallback(elem, pressed, x, y);
}
Ejemplo n.º 3
0
static void keyboardToggleCallback(GuiElement_t * elem, bool pressed, int x, int y)
{
	if( toggleElement(elem, pressed) )
	{
		//printf( "Show screen keyboard: %d", elem->toggled);
		SDL_ANDROID_ToggleScreenKeyboardWithoutTextInput();
	}
	GuiElement_t::defaultInputCallback(elem, pressed, x, y);
}
Ejemplo n.º 4
0
static void settingsToggleCallback(GuiElement_t * elem, bool pressed, int x, int y)
{
	if( toggleElement(elem, pressed) )
	{
		elem->toggled = false;
		settingsShowGui();
		settingsInitGui();
	}
}
Ejemplo n.º 5
0
static void ProcessClipboardImageCallback(GuiElement_t * elem, bool pressed, int x, int y)
{
	if( toggleElement(elem, pressed) )
	{
#ifdef __ANDROID__
		char buf[1024];
		SDL_ANDROID_GetClipboardText(buf, sizeof(buf));
		const char *pos = buf;
		for( unsigned int key = UnicodeFromUtf8(&pos); key != 0; key = UnicodeFromUtf8(&pos) )
		{
			processKeyInput((SDLKey)key, 0, 1);
			processKeyInput((SDLKey)key, 0, 0);
		}
#endif
	}
	GuiElement_t::defaultInputCallback(elem, pressed, x, y);
}
Ejemplo n.º 6
0
static void keyInputCallback(GuiElement_t * elem, bool pressed, int x, int y)
{
	if( toggleElement(elem, pressed) )
		processKeyInput(key, elem->toggled || SDL_GetKeyState(NULL)[key]);
}