Changeset f51359c in buchla-emu for emu/sdl.c


Ignore:
Timestamp:
09/05/2017 09:49:45 AM (7 years ago)
Author:
Alexander Heinrich <alex.heinrich@…>
Branches:
master
Children:
c8a92ef
Parents:
5475ecf (diff), ca77925 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
Message:

Merge branch 'master' of ssh://bob.lopatic.de:11501/home/git/buchla-emu into lcda

File:
1 edited

Legend:

Unmodified
Added
Removed
  • emu/sdl.c

    r5475ecf rf51359c  
    6767
    6868        bool rel_mod = false;
     69        uint32_t win = 0;
    6970
    7071        while (SDL_AtomicGet(&run) != 0) {
     
    101102                                SDL_AtomicSet(&run, 0);
    102103                                continue;
     104                        }
     105
     106                        if (ev.type == SDL_WINDOWEVENT) {
     107                                if (ev.window.event == SDL_WINDOWEVENT_FOCUS_GAINED) {
     108                                        ver("sdl ev win %u", ev.window.windowID);
     109                                        win = ev.window.windowID;
     110                                }
    103111                        }
    104112
     
    138146                        if (ev.type == SDL_TEXTINPUT) {
    139147                                ver("sdl ev text input %d", ev.text.text[0]);
    140                                 ser_text(&ev.text);
     148
     149                                if (win == ser_win) {
     150                                        ser_text(&ev.text);
     151                                }
     152
    141153                                continue;
    142154                        }
     
    144156                        if (ev.type == SDL_KEYDOWN) {
    145157                                ver("sdl ev key down %d", (int32_t)ev.key.keysym.sym);
    146                                 ser_key(&ev.key);
     158
     159                                if (win == ser_win) {
     160                                        ser_key(&ev.key);
     161                                }
     162                                else if (win == vid_win) {
     163                                        kbd_key(&ev.key, true);
     164                                }
     165
     166                                continue;
     167                        }
     168
     169                        if (ev.type == SDL_KEYUP) {
     170                                ver("sdl ev key up %d", (int32_t)ev.key.keysym.sym);
     171
     172                                if (win == vid_win) {
     173                                        kbd_key(&ev.key, false);
     174                                }
     175
    147176                                continue;
    148177                        }
Note: See TracChangeset for help on using the changeset viewer.