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:
assocs
combinators
core-foundation.run-loop
game.input
game.input.iokit
iokit
iokit.hid
kernel
namespaces
sequences
ui.private
;
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
]
[
game-devices-matching-seq
ui-running
get-global
[
[
"DeviceUsage"
of
{
4 5 8
}
member?
]
filter
]
when
set-hid-manager-matching
]
[
0
IOHIDManagerOpen
mach-error
]
[
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.cocoa
game.input.iokit
kernel
namespaces
ui.private
;
M:
iokit-game-input-backend
read-keyboard
ui-running
get-global
[
cocoa-keyboard
]
[
+keyboard-state+
get-global
clone
keyboard-state
boa
]
if
;
USING:
game.input
game.input.cocoa
game.input.iokit
kernel
namespaces
ui.private
;
M:
iokit-game-input-backend
read-mouse
ui-running
get-global
[
cocoa-mouse
]
[
+mouse-state+
get-global
]
if
;
USING:
accessors
game.input
game.input.iokit
kernel
namespaces
ui.backend.input-state
;
M:
iokit-game-input-backend
reset-mouse
reset-pointer-deltas
+mouse-state+
get-global
0
>>dx
0
>>dy
0
>>scroll-dx
0
>>scroll-dy
drop
;