类型 字符 对象 InputDevice 版本 发行 2024.3703 关键字 设备、输入、描述符
提供由 Corona 分配的唯一人类可读字符串,用于唯一识别设备。此描述符字符串旨在由使用特定设备设置键绑定的应用程序使用,例如连接到系统的第一个摇杆。
此描述符字符串键基于设备类型以及同一类型的设备数量生成。例如,如果您连接了两个摇杆和一个鼠标,那么 Corona 将分别为这些设备分配描述符字符串“JoyStick 1”、“Joystick 2”和“Mouse 1”。
-- Called when a key event has been received. local function onKeyEvent( event ) if event.device then print( "Device Descriptor: " .. event.device.descriptor ) end end -- Set up the above function to receive key events. Runtime:addEventListener( "key", onKeyEvent )