Handbook
Glossary
iokit-game-input-backend
Vocabulary
game
.
input
.
iokit
Definition
IN:
game.input.iokit
SINGLETON:
iokit-game-input-backend
Methods
USING:
core-foundation
core-foundation.run-loop
game.input
game.input.iokit
iokit.hid
kernel
namespaces
;
M:
iokit-game-input-backend
(close-game-input)
+hid-manager+
get-global
[
+hid-manager+
[
[
CFRunLoopGetMain
CFRunLoopDefaultMode
IOHIDManagerUnscheduleFromRunLoop
]
[
0
IOHIDManagerClose
drop
]
[
CFRelease
]
tri
f
]
change-global
f
+keyboard-state+
set-global
f
+mouse-state+
set-global
f
+controller-states+
set-global
]
when
;
USING:
combinators
core-foundation.run-loop
game.input
game.input.iokit
iokit
iokit.hid
;
M:
iokit-game-input-backend
(open-game-input)
make-hid-manager
{
[
initialize-variables
]
[
device-matched-callback
f
IOHIDManagerRegisterDeviceMatchingCallback
]
[
device-removed-callback
f
IOHIDManagerRegisterDeviceRemovalCallback
]
[
device-input-callback
f
IOHIDManagerRegisterInputValueCallback
]
[
0
IOHIDManagerOpen
mach-error
]
[
game-devices-matching-seq
set-hid-manager-matching
]
[
CFRunLoopGetMain
CFRunLoopDefaultMode
IOHIDManagerScheduleWithRunLoop
]
}
cleave
;
USING:
game.input
game.input.iokit
kernel
namespaces
sequences
;
M:
iokit-game-input-backend
(reset-game-input)
{
+hid-manager+
+keyboard-state+
+mouse-state+
+controller-states+
}
[
f
swap
set-global
]
each
;
USING:
game.input
game.input.iokit
kernel
;
M:
iokit-game-input-backend
calibrate-controller
drop
;
USING:
assocs
game.input
game.input.iokit
kernel
namespaces
sequences
;
M:
iokit-game-input-backend
get-controllers
+controller-states+
get-global
keys
[
controller
boa
]
map
;
USING:
accessors
game.input
game.input.iokit
iokit.hid
;
M:
iokit-game-input-backend
instance-id
handle>>
kIOHIDLocationIDKey
device-property
;
USING:
accessors
arrays
game.input
game.input.iokit
iokit.hid
kernel
;
M:
iokit-game-input-backend
product-id
handle>>
[
kIOHIDVendorIDKey
device-property
]
[
kIOHIDProductIDKey
device-property
]
bi
2array
;
USING:
accessors
game.input
game.input.iokit
iokit.hid
kernel
;
M:
iokit-game-input-backend
product-string
handle>>
[
kIOHIDProductKey
device-property
]
[
kIOHIDManufacturerKey
device-property
]
bi
" "
?glue
;
USING:
accessors
assocs
game.input
game.input.iokit
kernel
namespaces
;
M:
iokit-game-input-backend
read-controller
handle>>
+controller-states+
get-global
at
clone
;
USING:
game.input
game.input.iokit
kernel
namespaces
;
M:
iokit-game-input-backend
read-keyboard
+keyboard-state+
get-global
clone
keyboard-state
boa
;
USING:
game.input
game.input.iokit
namespaces
;
M:
iokit-game-input-backend
read-mouse
+mouse-state+
get-global
;
USING:
accessors
game.input
game.input.iokit
kernel
namespaces
;
M:
iokit-game-input-backend
reset-mouse
+mouse-state+
get-global
0
>>dx
0
>>dy
0
>>scroll-dx
0
>>scroll-dy
drop
;