Beispiel #1
0
static int ctrlpressed (void)
{
	return ispressed (DIK_LCONTROL) || ispressed (DIK_RCONTROL);
}
Beispiel #2
0
static int altpressed (void)
{
	return ispressed (DIK_LMENU) || ispressed (DIK_RMENU);
}
Beispiel #3
0
static int specialpressed (void)
{
	return ispressed (specialkeycode ());
}
Beispiel #4
0
static int shiftpressed (void)
{
	return ispressed (DIK_LSHIFT) || ispressed (DIK_RSHIFT);
}
Beispiel #5
0
BOOLE kbdDrvEventChecker(kbd_drv_pc_symbol symbol_key)
{
  ULO eol_evpos = kbd_state.eventsEOL.inpos;
  ULO eof_evpos = kbd_state.eventsEOF.inpos;
  
  ULO port, setting;
  
  for (;;)
  {
	
    if (kbd_drv_capture)
    {

#ifdef _DEBUG
      fellowAddLog( "Key captured: %s\n", kbdDrvKeyString( symbol_key ));
#endif

      kbd_drv_captured_key = symbol_key;
      return TRUE;
    }
	
    if (released(PCK_PAGE_DOWN))
    {
      if (ispressed(PCK_HOME))
      {
	issue_event(EVENT_RESOLUTION_NEXT);
      }
      else
      {
	if (ispressed(PCK_END))
	{
	  issue_event(EVENT_SCALEY_NEXT);
	}
      }
    }
    if (released(PCK_PAGE_UP))
    {
      if (ispressed(PCK_HOME))
      {
	issue_event(EVENT_RESOLUTION_PREV);
      }
      else
      {
	if (ispressed(PCK_END))
	{
	  issue_event(EVENT_SCALEY_PREV);
	}
      }
    }

    if(ispressed(PCK_RIGHT_WINDOWS) || ispressed(PCK_START_MENU))
      if(ispressed(PCK_LEFT_WINDOWS))
        if(ispressed(PCK_LEFT_CTRL))
          issue_event(EVENT_HARD_RESET);

    if (ispressed(PCK_PRINT_SCREEN))
      issue_event(EVENT_BMP_DUMP);

#ifdef RETRO_PLATFORM
    if(RP.GetHeadlessMode())
    {
      if( ispressed ( PCK_LEFT_ALT ) )
        if(ispressed ( PCK_F4 ) )
          issue_event(EVENT_EXIT);

      if(!RP.GetEmulationPaused())
      {
	if( pressed ( RP.GetEscapeKey() ))
	{
	  RP.SetEscapeKeyHeld(true);
	  return TRUE;
	}
	if( released ( RP.GetEscapeKey() ))
	{
	  ULONGLONG t = RP.SetEscapeKeyHeld(false);
          
          if((t != 0) && (t < RP.GetEscapeKeyHoldTime())) 
	  {
            UBY a_code = kbd_drv_pc_symbol_to_amiga_scancode[RP.GetEscapeKey()];

	    fellowAddLog("RetroPlatform escape key held shorter than escape interval, simulate key being pressed for %u milliseconds...\n",
              t);
            RP.SetEscapeKeySimulatedTargetTime(RP.GetTime() + RP.GetEscapeKeyHoldTime());
            kbdKeyAdd(a_code); // hold escape key
            return TRUE;
	  }
          else
            return TRUE;
	}
      }
      else 
      {
	if( pressed ( RP.GetEscapeKey() ))
	  RP.PostEscaped();
      }
    }
#endif

#ifdef RETRO_PLATFORM
    if(!RP.GetHeadlessMode())
#endif
    if( released( PCK_F11 ))
    {
      issue_event( EVENT_EXIT );
    }
	
#ifdef RETRO_PLATFORM
    if(!RP.GetHeadlessMode())
#endif
    if( released( PCK_F12 ))
    {
      mouseDrvToggleFocus();
      joyDrvToggleFocus();
      break;
    }
	
    if( ispressed(PCK_HOME) )
    {
      if( released( PCK_F1 )) issue_event( EVENT_INSERT_DF0 );
      if( released( PCK_F2 )) issue_event( EVENT_INSERT_DF1 );
      if( released( PCK_F3 )) issue_event( EVENT_INSERT_DF2 );
      if( released( PCK_F4 )) issue_event( EVENT_INSERT_DF3 );
    }
    else if( ispressed(PCK_END) )
    {
      if( released( PCK_F1 )) issue_event( EVENT_EJECT_DF0 );
      if( released( PCK_F2 )) issue_event( EVENT_EJECT_DF1 );
      if( released( PCK_F3 )) issue_event( EVENT_EJECT_DF2 );
      if( released( PCK_F4 )) issue_event( EVENT_EJECT_DF3 );
    }

    // Check joysticks replacements
    // New here: Must remember last value to decide if a change has happened
	
    for( port = 0; port < 2; port++ )
    {
      for( setting = 0; setting < 2; setting++ )
      {
	if( kbd_drv_joykey_enabled[port][setting] )
	{
	  // Here the gameport is set up for input from the specified set of joykeys 
	  // Check each key for change
	  int direction;
	  for (direction = 0; direction < MAX_JOYKEY_VALUE; direction++)
	  {
	    if (symbol_key == kbd_drv_joykey[setting][direction])
	    {
	      if( pressed( symbol_key ) || released( symbol_key ))
	      {
		kbdEventEOLAdd(kbd_drv_joykey_event[port][pressed(symbol_key)][direction]);
	      }
	    }
	  }
	}
      }
    }
    break;
  }
  
  return (eol_evpos != kbd_state.eventsEOL.inpos) ||
	(eof_evpos != kbd_state.eventsEOF.inpos);
}