--- previous/src/control.c 2018/04/24 19:25:30 1.1.1.2 +++ previous/src/control.c 2018/04/24 19:31:11 1.1.1.4 @@ -27,6 +27,7 @@ const char Control_fileid[] = "Hatari co #include "debugui.h" #include "file.h" #include "log.h" +#include "screen.h" #include "shortcut.h" #include "str.h" @@ -54,19 +55,13 @@ static bool bRemotePaused; static bool Control_InsertKey(const char *event) { const char *key = NULL; - bool up, down; if (strncmp(event, "keypress ", 9) == 0) { key = &event[9]; - down = up = true; } else if (strncmp(event, "keydown ", 8) == 0) { key = &event[8]; - down = true; - up = false; } else if (strncmp(event, "keyup ", 6) == 0) { key = &event[6]; - down = false; - up = true; } if (!(key && key[0])) { fprintf(stderr, "ERROR: '%s' contains no key press/down/up event\n", event); @@ -82,20 +77,7 @@ static bool Control_InsertKey(const char key, keycode); return false; } - if (down) { -// IKBD_PressSTKey(keycode, true); - } - if (up) { -// IKBD_PressSTKey(keycode, false); - } - } else { - if (down) { -// Keymap_SimulateCharacter(key[0], true); - } - if (up) { -// Keymap_SimulateCharacter(key[0], false); - } - } + } #if 0 fprintf(stderr, "Simulated key %s of %d\n", (down? (up? "press":"down") :"up"), key); @@ -214,14 +196,6 @@ static bool Control_SetPath(char *name) const char *name; char *path; } item[] = { - { "memauto", ConfigureParams.Memory.szAutoSaveFileName }, - { "memsave", ConfigureParams.Memory.szMemoryCaptureFileName }, -// { "midiin", ConfigureParams.Midi.sMidiInFileName }, -// { "midiout", ConfigureParams.Midi.sMidiOutFileName }, -// { "printout", ConfigureParams.Printer.szPrintToFileName }, -// { "soundout", ConfigureParams.Sound.szYMCaptureFileName }, -// { "rs232in", ConfigureParams.RS232.szInFileName }, -// { "rs232out", ConfigureParams.RS232.szOutFileName }, { NULL, NULL } }; int i; @@ -499,6 +473,7 @@ const char *Control_SetSocket(const char */ void Control_ReparentWindow(int width, int height, bool noembed) { +#if 0 Display *display; Window parent_win, sdl_win, wm_win; const char *parent_win_id; @@ -515,7 +490,7 @@ void Control_ReparentWindow(int width, i } SDL_VERSION(&info.version); - if (!SDL_GetWMInfo(&info)) { + if (!SDL_GetWindowWMInfo(sdlWindow, &info)) { Log_Printf(LOG_WARN, "Failed to get SDL_GetWMInfo()\n"); return; } @@ -544,6 +519,9 @@ void Control_ReparentWindow(int width, i } } info.info.x11.unlock_func(); +#else + fprintf(stderr, "FIXME: Port Control_ReparentWindow to SDL2\n"); +#endif } /** @@ -553,7 +531,7 @@ static int Control_GetUISocket(void) { SDL_SysWMinfo info; SDL_VERSION(&info.version); - if (!SDL_GetWMInfo(&info)) { + if (!SDL_GetWindowWMInfo(sdlWindow, &info)) { Log_Printf(LOG_WARN, "Failed to get SDL_GetWMInfo()\n"); return 0; }