/*
*     ___                       ____               __
*    / _ \___ _    _____ ____  /  _/__  ___  __ __/ /_
*   / ___/ _ \ |/|/ / -_) __/ _/ // _ \/ _ \/ // / __/
*  /_/   \___/__,__/\__/_/   /___/_//_/ .__/\_,_/\__/
*                                    /_/
*
*   Original Code by John Garrison
*   Written July 17,22, 1999
*   To be released under the LGPL
*
*   Keyboard interface routines
*
*   See LICENSE.TXT for more LGPL info
*/

#include "SDL/SDL.h"
#include "powerinput.h"
#include "keyboard.h"

/////////////////////////////////////////////////
//          KEYBOARD READING ROUTINES          //
/////////////////////////////////////////////////

/* Poll the keyboard */
Uint8 *PI_GetKeyboardState()
{
   return SDL_GetKeyState(NULL);
}



/* Find out if a key is down */
int PI_IsKeyDown(int Key)
{
   Uint8 *keys;

   PI_PollEvent();
   keys = PI_GetKeyboardState();

   if (keys[Key] == SDL_PRESSED)
      return 1;
   else return 0;
}



/* Find out if a key was pressed */
int PI_WasKeyPressed(Uint8 *Keys, int Key)
{
   if (Keys[Key] == SDL_PRESSED)
      return 1;
   else return 0;
}



/* Poll the keyboard modifiers */
PIMod PI_GetModifierState()
{
   return SDL_GetModState();
}



/* Find out if a modifier is on */
/*int PI_IsModifierOn(int Mod)
{
   PIMod mods;

   mods = PI_GetModifierState();

   if (mods[Mod] == SDL_PRESSED)
      return 1;
   else return 0;
}
*/


/* Find out if a key was pressed */
/*int PI_WasModifierPressed(Uint8 *Mods, int Mod)
{
   if (Mods[Mod] == SDL_PRESSED)
      return 1;
   else return 0;
}
*/

