how to change the input mode of the mobile using j2me (MIDP2.0)? - java-me

I am working in j2me midp2.0 environment. Now, I want to draw String (custom item) based on user key pressed event. Here, my problem is, some phones default input mode is numeric and I can't be able to draw Strings. How to change this input mode to Strings and vice versa?

I think you manually get the key values and change it. On key press event you find which key pressed based on that you write a login to get numeric values or character, etc.

Related

2d barcode scanner inconsistent behavior in Ubuntu 20.04

I am using 2d barcode scanner ( Plug and Play ). This behaves inconsistently when used in any input field or text editor. e.g. Say I scan a barcode while my cursor is blinking in input field of Java swing application, sometimes the input from barcode gets printed in input field really quickly and sometimes I could see characters are getting printed in input field. There is a visible lag of ~second for each character.
This behavior is similar for text editor as well. Not sure how I can check this point. Is there any way to debug this point ?

Changing part of text to a different color in an input

Am a newbee to javascript but have plenty of experience in VB, C, and even 86 assembler. Maybe I am trying to do the impossible in porting a VB app to js here. Basically, I need to change the color for only part of the string in an input element. Here is the problem:
A function takes an entered input box text field, and processes it first to see if it is in conformity to a set of requirements. If part of that string is not in conformity, I would like to in some way highlight that part in the input field. For instance, maybe I can send back the string to the input element (eg using the value attribute) but with some highlighting for that part, such as changing its text color or background color. Is this possible in js?
I'm not sure whether you can change colors of partial text in a simple text box. But what you're trying to do is certainly possible with this: https://editorjs.io/
The example on the homepage shows you how.
I hope this is a possibility for you and not too heavy for your purpose.

vtkInteractorStyleRubberBandPick: Set selection mode without pressing key

The class vtkInteractorStyleRubberBandPick allows selection of a rectangular window, when 'r' is pressed, and selection of a 1x1 window, when 'p' is pressed.
Is there a way to get the key that is currently pressed (the current selection mode)?
Is it possible to set the selection mode 'r' or 'p' in the code (i'm using pyqt and would like to choose the mode by checking a box in a gui)?
I don't speak python, so I don't know what extra obstacles you will have, but in c++ you could do this:
ad 1) the picking mode is not publicly accesible, it is represented by a protected variable CurrentMode (see the c++ source code). You would have to create your own class derived from vtkInteractorStyleRubberBandPick and define new public method for it that would return the mode.
ad 2) Again, not directly. But if you were to derive your own class anyway, you could also define your own method for setting the mode, as there is none. Without it, I suppose you could have your check box give focus to the vtk window and fire an R-key-pressed event...sounds overly complicated, but it would probably work.

How can add space-key to jump for Platform behavior in construct 2?

I'm using the Platform Behavior in Construct 2 for a Windows 10 game. In addition to the arrow key, I would like to use the Space bar to get the sprite to jump. Can I tell it to call into the Platform behavior somehow or get it to let me map space bar as well as up arrow to 'jump'?
You certainly can. You can use an action called "Simulate Control" to simulate pressing left, right, or up. So as your event, use Keyboard->on Key Pressed (Space Bar). Then for the action Player->Simulate Control (Up Arrow). This will allow you to press space bar to have your character jump. Additionally, you can turn off default controls for the platform behavior and do custom controls for left, right, and up using the same strategy.
The best way to go about doing this is by adding an event that handles the Space Button. Make sure to add the keyboard object in your layout, and in the event sheet, you want to make an event that handles the keyboard -> on key pressed (choose the spacebar when asked) -> choose whatever object you want to jump with the Platform behavior -> Set Vector Y to whatever increment you'd like to jump. Be sure to list this value as negative. The y-axis in C2 is inverted, so negative numbers mean up.
Hope this helps!

Detecting external keyboard Key Down Events in IOS without EditText Field

I'm trying to detect key pressed for an external keyboard (via bluetooth) with an 4th generation iPad. I was only able to do so when the focus is on a EditText Field.
Without the edit text field, the key down events aren't captured by the program. Is there any work around for this issue?
I've tried to following, but this doesn't seem to work:
-(NSArray *) keyCommands
{
}

Resources