-
Notifications
You must be signed in to change notification settings - Fork 1
/
keyboard.go
131 lines (123 loc) · 4.52 KB
/
keyboard.go
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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
// Copyright (C) 2012-2014 by krepa098. All rights reserved.
// Use of this source code is governed by a zlib-style
// license that can be found in the license.txt file.
package gosfml2
// #include <SFML/Window/Keyboard.h>
import "C"
/////////////////////////////////////
/// CONSTS
/////////////////////////////////////
const (
KeyA = iota ///< The A key
KeyB ///< The B key
KeyC ///< The C key
KeyD ///< The D key
KeyE ///< The E key
KeyF ///< The F key
KeyG ///< The G key
KeyH ///< The H key
KeyI ///< The I key
KeyJ ///< The J key
KeyK ///< The K key
KeyL ///< The L key
KeyM ///< The M key
KeyN ///< The N key
KeyO ///< The O key
KeyP ///< The P key
KeyQ ///< The Q key
KeyR ///< The R key
KeyS ///< The S key
KeyT ///< The T key
KeyU ///< The U key
KeyV ///< The V key
KeyW ///< The W key
KeyX ///< The X key
KeyY ///< The Y key
KeyZ ///< The Z key
KeyNum0 ///< The 0 key
KeyNum1 ///< The 1 key
KeyNum2 ///< The 2 key
KeyNum3 ///< The 3 key
KeyNum4 ///< The 4 key
KeyNum5 ///< The 5 key
KeyNum6 ///< The 6 key
KeyNum7 ///< The 7 key
KeyNum8 ///< The 8 key
KeyNum9 ///< The 9 key
KeyEscape ///< The Escape key
KeyLControl ///< The left Control key
KeyLShift ///< The left Shift key
KeyLAlt ///< The left Alt key
KeyLSystem ///< The left OS specific key: window (Windows and Linux), apple (MacOS X), ...
KeyRControl ///< The right Control key
KeyRShift ///< The right Shift key
KeyRAlt ///< The right Alt key
KeyRSystem ///< The right OS specific key: window (Windows and Linux), apple (MacOS X), ...
KeyMenu ///< The Menu key
KeyLBracket ///< The [ key
KeyRBracket ///< The ] key
KeySemiColon ///< The ; key
KeyComma ///< The , key
KeyPeriod ///< The . key
KeyQuote ///< The ' key
KeySlash ///< The / key
KeyBackSlash ///< The \ key
KeyTilde ///< The ~ key
KeyEqual ///< The = key
KeyDash ///< The - key
KeySpace ///< The Space key
KeyReturn ///< The Return key
KeyBack ///< The Backspace key
KeyTab ///< The Tabulation key
KeyPageUp ///< The Page up key
KeyPageDown ///< The Page down key
KeyEnd ///< The End key
KeyHome ///< The Home key
KeyInsert ///< The Insert key
KeyDelete ///< The Delete key
KeyAdd ///< +
KeySubtract ///< -
KeyMultiply ///< *
KeyDivide ///< /
KeyLeft ///< Left arrow
KeyRight ///< Right arrow
KeyUp ///< Up arrow
KeyDown ///< Down arrow
KeyNumpad0 ///< The numpad 0 key
KeyNumpad1 ///< The numpad 1 key
KeyNumpad2 ///< The numpad 2 key
KeyNumpad3 ///< The numpad 3 key
KeyNumpad4 ///< The numpad 4 key
KeyNumpad5 ///< The numpad 5 key
KeyNumpad6 ///< The numpad 6 key
KeyNumpad7 ///< The numpad 7 key
KeyNumpad8 ///< The numpad 8 key
KeyNumpad9 ///< The numpad 9 key
KeyF1 ///< The F1 key
KeyF2 ///< The F2 key
KeyF3 ///< The F3 key
KeyF4 ///< The F4 key
KeyF5 ///< The F5 key
KeyF6 ///< The F6 key
KeyF7 ///< The F7 key
KeyF8 ///< The F8 key
KeyF9 ///< The F9 key
KeyF10 ///< The F10 key
KeyF11 ///< The F11 key
KeyF12 ///< The F12 key
KeyF13 ///< The F13 key
KeyF14 ///< The F14 key
KeyF15 ///< The F15 key
KeyPause ///< The Pause key
KeyCount ///< Keep last -- the total number of keyboard keys
)
type KeyCode int
/////////////////////////////////////
/// FUNCTIONS
/////////////////////////////////////
//Check if a key is pressed
//
// key: Key to check
func KeyboardIsKeyPressed(key KeyCode) bool {
return sfBool2Go(C.sfKeyboard_isKeyPressed(C.sfKeyCode(key)))
}