鼠标键盘动作库


鼠标和键盘动作

你可以在鼠标和键盘动作库中找到轮询和处理键盘或鼠标设备输入所需的操作。 此动作库可用动作如下所示:

检测鼠标按钮 如果鼠标按住
检测到鼠标点击 如果鼠标点击
检测到鼠标松开 如果鼠标松开
检测键盘 如果键盘按住
检测键盘点击 如果键盘点击
检测键盘松开 如果键盘被松开

The other three actions here refer to the virtual keyboard. If you require text or numeric input in your game on a touchscreen device, then you can use the virtual keyboard actions provided to use the device OS keyboard. These actions will call up or hide the OS keyboard and accept input from it just the same as a physical keyboard, so the regular GameMaker Studio 2 keyboard actions should all work with virtual keyboards (for example, the "If Key Released" action), and any input from the virtual keyboard will be stored in the different keyboard variables, like keyboard_string, or keyboard_last_char, etc...).

Opening or closing the virtual keyboard will generate System Asynchronous Events, in which the async_load DS map will be populated with the following key/value pairs:

The available virtual keyboard actions are:

显示虚拟键盘 显示虚拟键盘
隐藏虚拟键盘 隐藏虚拟键盘
获取虚拟键盘高度 获取虚拟键盘高度
如果虚拟键盘正在显示 如果虚拟键盘正在显示