J2ME development notes - keyboard response

xiaoxiao2021-03-06  94

J2ME development notes - keyboard response

Different models are different for the response of the keyboard event. After my test, NOKIA 7210, 3100 can only accept one button information at a time. (I wrote a test program, I found that if a button is not released after it is pressed, the keypressed event will not be generated, that is, the other keys are operational. So, when using the buffer processing, if the cockstimate is controlled, if the specified only Can move in four directions. If the UP is pressed, then press LEFT, the movement direction of the elf does not change. However, the button is buffered. Press UP, press LEFT to do not release, release the UP --- Elf will move to the left. (In the UP, the keypressed event is generated! Strange? After the UP is released, I don't have "press" Left this action - LEFT button is pressed before the UP is released without loosening. It seems that the machine has been monitoring the state of the key on the keyboard, and there is a waiting queue.) It is different on the WTK standard emulator. It accepts multiple buttons "simultaneously" presses the events. So if the IF processing is used in four parallel IFs, the wizy can be moved obliquely. If you are processed with if else, if you have already pressed a direction button, then press another one, whether or not the direction is changed in the order of the IF ELSE statement. That is, if it is if (Up) else if (left), the UP button will be checked first, so if you have already pressed Left, press UP to move up, it is not possible. (This natural :) other models have not been tried because there is no machine in hand. It should be the same. If you want to discuss all kinds of questions developed by J2ME, welcome email to mobiledev@163.com

转载请注明原文地址:https://www.9cbs.com/read-98465.html

New Post(0)