站内搜索: 请输入搜索关键词
当前页面: 图书首页 > MIDP Style Guide for the Java 2 Platform, Micro Edition

MIDP Style Guide for the Java 2 Platform, Micro Edition

[ directory ] Previous Section Next Section

11.2 Key Latching and Suppression

Using key latching enables an application developer to efficiently determine whether the user has pressed a key since the last time through the game loop. Key suppression keeps the regular event loop from handling actions for the game canvas. Suppressing events can improve performance by eliminating unnecessary system calls to the keyPressed, keyRepeated, and keyReleased methods.

Application Developers

Recommend: graphics/bulb2_icon.gif Use key latching and key suppression together to save both time and memory.

    [ directory ] Previous Section Next Section