File: keyboard.cpp

package info (click to toggle)
mazeofgalious 0.62.dfsg2-3
  • links: PTS
  • area: main
  • in suites: jessie, jessie-kfreebsd, wheezy
  • size: 12,668 kB
  • ctags: 803
  • sloc: cpp: 23,568; makefile: 69
file content (30 lines) | stat: -rw-r--r-- 501 bytes parent folder | download | duplicates (6)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
#ifdef _WIN32
#include <windows.h>
#include <windowsx.h>
#else
#include <sys/time.h>
#include <time.h>
#endif

#include "SDL/SDL.h"

bool IsAltPressed()
{
	SDLMod modifiers;

	SDL_PumpEvents();
	modifiers=SDL_GetModState();
   
	return ((modifiers & KMOD_ALT) != 0);
} /* IsAltPressed */ 


bool IsAltPressed2()
{
#ifdef _WIN32
    return (GetKeyState (VK_MENU) & 0x8000) ? true : false;
#else
	SDL_PumpEvents();
    return ( (SDL_GetModState() & KMOD_ALT) != 0);
#endif
}