Joybutton to show menu
Added experimental option to assign a joystick button (for now, button 1) to open the GUI menu.
This commit is contained in:
parent
2c226e99d8
commit
50281a8f90
3 changed files with 30 additions and 26 deletions
|
@ -622,7 +622,7 @@ void virtualdevice_init (void)
|
|||
|
||||
static int real_main2 (int argc, TCHAR **argv)
|
||||
{
|
||||
printf("Uae4arm v0.5 for Raspberry Pi by Dimitris (MiDWaN) Panokostas\n");
|
||||
printf("Uae4arm-Amiberry optimized edition for Raspberry Pi by Dimitris (MiDWaN) Panokostas\n");
|
||||
#ifdef PANDORA_SPECIFIC
|
||||
SDL_Init(SDL_INIT_NOPARACHUTE | SDL_INIT_VIDEO);
|
||||
#else
|
||||
|
|
|
@ -106,10 +106,10 @@ const char *tapDelayValues[] = { "Normal", "Short", "None" };
|
|||
StringListModel tapDelayList(tapDelayValues, 3);
|
||||
#endif
|
||||
|
||||
static const int ControlKey_SDLKeyValues[] = { SDLK_F11, SDLK_F12, SDLK_LALT, SDLK_LCTRL };
|
||||
static const int ControlKey_SDLKeyValues[] = { SDLK_F11, SDLK_F12, SDL_JOYBUTTONDOWN };
|
||||
|
||||
const char *ControlKeyValues[] = { "F11", "F12", "LeftAlt", "LeftCtrl" };
|
||||
StringListModel ControlKeyList(ControlKeyValues, 4);
|
||||
const char *ControlKeyValues[] = { "F11", "F12", "JoyButton1" };
|
||||
StringListModel ControlKeyList(ControlKeyValues, 3);
|
||||
|
||||
const char *mappingValues[] =
|
||||
{
|
||||
|
|
|
@ -883,33 +883,37 @@ int handle_msgpump (void)
|
|||
uae_quit();
|
||||
break;
|
||||
|
||||
case SDL_JOYBUTTONDOWN:
|
||||
if (currprefs.key_for_menu == SDL_JOYBUTTONDOWN && rEvent.jbutton.button == 1)
|
||||
inputdevice_add_inputcode (AKS_ENTERGUI, 1);
|
||||
break;
|
||||
|
||||
case SDL_KEYDOWN:
|
||||
|
||||
if(rEvent.key.keysym.sym == currprefs.key_for_menu)
|
||||
inputdevice_add_inputcode (AKS_ENTERGUI, 1);
|
||||
switch(rEvent.key.keysym.sym)
|
||||
{
|
||||
#ifdef CAPSLOCK_DEBIAN_WORKAROUND
|
||||
case SDLK_CAPSLOCK: // capslock
|
||||
// Treat CAPSLOCK as a toggle. If on, set off and vice/versa
|
||||
ioctl(0, KDGKBLED, &kbd_flags);
|
||||
ioctl(0, KDGETLED, &kbd_led_status);
|
||||
if ((kbd_flags & 07) & LED_CAP)
|
||||
{
|
||||
// On, so turn off
|
||||
kbd_led_status &= ~LED_CAP;
|
||||
kbd_flags &= ~LED_CAP;
|
||||
inputdevice_do_keyboard(AK_CAPSLOCK, 0);
|
||||
} else {
|
||||
// Off, so turn on
|
||||
kbd_led_status |= LED_CAP;
|
||||
kbd_flags |= LED_CAP;
|
||||
inputdevice_do_keyboard(AK_CAPSLOCK, 1);
|
||||
}
|
||||
ioctl(0, KDSETLED, kbd_led_status);
|
||||
ioctl(0, KDSKBLED, kbd_flags);
|
||||
break;
|
||||
#endif
|
||||
#ifdef CAPSLOCK_DEBIAN_WORKAROUND
|
||||
case SDLK_CAPSLOCK: // capslock
|
||||
// Treat CAPSLOCK as a toggle. If on, set off and vice/versa
|
||||
ioctl(0, KDGKBLED, &kbd_flags);
|
||||
ioctl(0, KDGETLED, &kbd_led_status);
|
||||
if ((kbd_flags & 07) & LED_CAP)
|
||||
{
|
||||
// On, so turn off
|
||||
kbd_led_status &= ~LED_CAP;
|
||||
kbd_flags &= ~LED_CAP;
|
||||
inputdevice_do_keyboard(AK_CAPSLOCK, 0);
|
||||
} else {
|
||||
// Off, so turn on
|
||||
kbd_led_status |= LED_CAP;
|
||||
kbd_flags |= LED_CAP;
|
||||
inputdevice_do_keyboard(AK_CAPSLOCK, 1);
|
||||
}
|
||||
ioctl(0, KDSETLED, kbd_led_status);
|
||||
ioctl(0, KDSKBLED, kbd_flags);
|
||||
break;
|
||||
#endif
|
||||
|
||||
case SDLK_LSHIFT: // Shift key
|
||||
inputdevice_do_keyboard(AK_LSH, 1);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue