void SDL_AtariXbios_PostMouseEvents(_THIS, SDL_bool buttonEvents) { if (SDL_AtariXbios_enabled==0) { return; } /* Mouse motion ? */ if (SDL_AtariXbios_mousex || SDL_AtariXbios_mousey) { SDL_PrivateMouseMotion(0, 1, SDL_AtariXbios_mousex, SDL_AtariXbios_mousey); SDL_AtariXbios_mousex = SDL_AtariXbios_mousey = 0; } /* Mouse button ? */ if (buttonEvents && (SDL_AtariXbios_mouseb != atari_prevmouseb)) { int i; for (i=0;i<2;i++) { int curbutton, prevbutton; curbutton = SDL_AtariXbios_mouseb & (1<<i); prevbutton = atari_prevmouseb & (1<<i); if (curbutton && !prevbutton) { SDL_PrivateMouseButton(SDL_PRESSED, atari_GetButton(i), 0, 0); } if (!curbutton && prevbutton) { SDL_PrivateMouseButton(SDL_RELEASED, atari_GetButton(i), 0, 0); } } atari_prevmouseb = SDL_AtariXbios_mouseb; } }
void AtariIkbd_PumpEvents(_THIS) { int i, specialkeys; SDL_keysym keysym; /*--- Send keyboard events ---*/ for (i=0; i<ATARIBIOS_MAXKEYS; i++) { /* Key pressed ? */ if (SDL_AtariIkbd_keyboard[i]==KEY_PRESSED) { SDL_PrivateKeyboard(SDL_PRESSED, SDL_Atari_TranslateKey(i, &keysym, SDL_TRUE)); SDL_AtariIkbd_keyboard[i]=KEY_UNDEFINED; } /* Key released ? */ if (SDL_AtariIkbd_keyboard[i]==KEY_RELEASED) { SDL_PrivateKeyboard(SDL_RELEASED, SDL_Atari_TranslateKey(i, &keysym, SDL_FALSE)); SDL_AtariIkbd_keyboard[i]=KEY_UNDEFINED; } } /*--- Send mouse events ---*/ /* Mouse motion ? */ if (SDL_AtariIkbd_mousex || SDL_AtariIkbd_mousey) { SDL_PrivateMouseMotion(0, 1, SDL_AtariIkbd_mousex, SDL_AtariIkbd_mousey); SDL_AtariIkbd_mousex = SDL_AtariIkbd_mousey = 0; } /* Mouse button ? */ if (SDL_AtariIkbd_mouseb != atari_prevmouseb) { for (i=0;i<2;i++) { int curbutton, prevbutton; curbutton = SDL_AtariIkbd_mouseb & (1<<i); prevbutton = atari_prevmouseb & (1<<i); if (curbutton && !prevbutton) { SDL_PrivateMouseButton(SDL_PRESSED, atari_GetButton(i), 0, 0); } if (!curbutton && prevbutton) { SDL_PrivateMouseButton(SDL_RELEASED, atari_GetButton(i), 0, 0); } } atari_prevmouseb = SDL_AtariIkbd_mouseb; } }
void AtariIkbd_PumpEvents(_THIS) { int i; SDL_keysym keysym; int specialkeys; /*--- Send keyboard events ---*/ /* Update caps lock state */ if (SDL_AtariIkbd_keyboard[SCANCODE_CAPSLOCK]==KEY_PRESSED) { caps_state ^= 1; } /* Choose the translation table */ specialkeys=KT_UNSHIFT; if ((SDL_AtariIkbd_keyboard[SCANCODE_LEFTSHIFT]==KEY_PRESSED) || (SDL_AtariIkbd_keyboard[SCANCODE_RIGHTSHIFT]==KEY_PRESSED)) { specialkeys = KT_SHIFT; } if (caps_state) { specialkeys = KT_CAPS; } /* Now generate events */ for (i=0; i<ATARIBIOS_MAXKEYS; i++) { /* Key pressed ? */ if (SDL_AtariIkbd_keyboard[i]==KEY_PRESSED) { SDL_PrivateKeyboard(SDL_PRESSED, TranslateKey(i, specialkeys, &keysym, SDL_TRUE)); SDL_AtariIkbd_keyboard[i]=KEY_UNDEFINED; } /* Key released ? */ if (SDL_AtariIkbd_keyboard[i]==KEY_RELEASED) { SDL_PrivateKeyboard(SDL_RELEASED, TranslateKey(i, specialkeys, &keysym, SDL_FALSE)); SDL_AtariIkbd_keyboard[i]=KEY_UNDEFINED; } } /*--- Send mouse events ---*/ /* Mouse motion ? */ if (SDL_AtariIkbd_mousex || SDL_AtariIkbd_mousey) { SDL_PrivateMouseMotion(0, 1, SDL_AtariIkbd_mousex, SDL_AtariIkbd_mousey); SDL_AtariIkbd_mousex = SDL_AtariIkbd_mousey = 0; } /* Mouse button ? */ if (SDL_AtariIkbd_mouseb != atari_prevmouseb) { for (i=0;i<2;i++) { int curbutton, prevbutton; curbutton = SDL_AtariIkbd_mouseb & (1<<i); prevbutton = atari_prevmouseb & (1<<i); if (curbutton && !prevbutton) { SDL_PrivateMouseButton(SDL_PRESSED, atari_GetButton(i), 0, 0); } if (!curbutton && prevbutton) { SDL_PrivateMouseButton(SDL_RELEASED, atari_GetButton(i), 0, 0); } } atari_prevmouseb = SDL_AtariIkbd_mouseb; } }