Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
有一种方法可以检查“关键”用户是否按下:
Gosu.button_down? id
id 参数可以是 Gosu::KB_UP、Gosu::KB_1、Gosu::KB_F1... 但是有什么方法可以获取用户按下的键的 id 吗?
有一个方法叫做button_down(id),你需要重写它。
button_down(id)
class Window < Gosu::Window def button_down(id) puts id end end