Lwuit on nokia. Setting a command to the game fire key - java-me

This may seem trivial, but i'm working on a project to be deployed exclusively on nokia phones, and all i want is to create a command and set it to the "GAME_FIRE" center key. For some reason, when adding lwuit commands, LWUIT skips the game fire key, and instead creates a defaut menu command that then shows the added commands. Please help.

As far as I understand, LWUIT never uses the center key to commands. It wont event let you have two menus,it will always use one soft key for the main (the first) command, and all the other commands will be on a menu in the other soft button

Use
Display.getInstance().setThirdSoftButton(true);
This will set the label on the fire key as well.

Related

Command issue in J2ME

Currently I am working on J2ME App and I am facing command issue in j2me.
When I am adding any command on form its coming under options, not coming directly on screen.
Command selCommand = new Command("Select");
This select command is not coming directly on screen, options is coming on screen then click on option command then Select command is coming.
I want Select command on screen instead of option.
High Level GUI coding in JavaME doesn't let you decide how a Command should be displayed.
The same code may display a Command directly on the screen on some devices, but under Options on other devices. So don't have any control of that.
Your best chance is to look into priorities. By setting a high priority on your Command, you may be lucky that it displays directly on the screen instead of under Options. It is not something you should count on though, since it's not required by the specification, but I suspect at least many devices would do that.
J2ME doesn't let you allow to add commands on Screen it will come in menu but we can set priority to command so that they can be visible in left or right side.
even if you want to add command on Screen you have to use buttons.
Container containerbtn;
Button btnsel = new Button("Select");
containerbtn.addComponent(btnsel );
this.addComponent(containerbtn);

Show only 2 commands in the menu bar in Lwuit or Native J2ME

I added 2 commands to my form in lwuit.
form.addCommand(test);
form.setBackCommand(exitCommand);
I changed the command behavior to COMMAND_BEHAVIOR_NATIVE, so i can show the status, and my commands appear at the bottom too, but they appear exit at the right ..and test Command in the middle.
I want to show only 2 commands layout in the menu bar, Exit on the right and options list that contains test on the left.
How can i do that?
First get the back Command and remove it. After this, add the exit Command like a standard Commandwith addCommand. Try this, if this doesn´t work we can try something else.
I don't know about LWUIT since I've never used it, but with native JavaME you sadly have no control of this. It is the individual device that decides where to place the commands.
You can move them around by changing the priority parameter, and you may be able to achieve an acceptable result that way, but only on some devices. The same code will give a different result on other devices.

How do I stop wxhaskell from beeping on enter in text controls?

I've played around with processEnter, on command, and on anyKey with textEntry to no avail. I've been looking through the massive amount of documentation for wx-core, but I don't see anything that'll help. I'm using wxhaskell 0.13.2.1 on Windows 8.
You need to use wxTE_PROCESS_ENTER style to have a chance of capturing the Enter key in a wxTextCtrl. If you don't use it, this key is used for activating the default dialog button -- or beeping, under Windows, if there is no such button.

Command in LWUIT

How to add more than 2 command in a single row in at the Footer in lwuit Form ,suppose I want to add Back,Select,and Exit Command in a single row,how can I do that? Help with some example.
Use Display.getInstance().setThirdSoftButton(true); for showing three softbutton's.
You can also write your_Form.setDefaultCommand(the_command_in_the_middle);
I noticed that setting commandBehaviour to SoftKey in the resource editor makes all your commands align on one side, typical blackberry behaviour, works on nokia also. It is a property of one of the constants of the theme in the resource editor.

Call my application through keyword

My problem is very simple, but implementation can be hard!
I want that my application (Windows Application:: Visual C# .net) is launched whenever the user uses some keys combinations (on his keyboard).
For example it types Ctrl+W+W and my application is launched, that's all, I want the simplest implementation, less code, memory...
Thanks :D
You would need to write a keylogger type application in conjunction with your app which monitors for keyboard events. Once your specific shortcut is triggered you could then load your application.
See here for information on how to capture keystrokes.
Create a shortcut to the application, and assign a hot-key combination to the shortcut. Depending on the O/S, not every keystroke combination can be assigned to a shortcut, e.g. you may be able to assign Ctrl+Alt+W but not Ctrl+W+W.
On Windows, you can create a shortcut (on the desktop) to your application.
When you open the properties of the shortcut, on the second tab (labeled "Shortcut"), you can assign a shortcut key. But you can use only Ctrl+Alt+key shortcuts.
I don't think this is possible in the way that you framed this question. What is possible, however, is to have your application run automatically on startup without showing any forms, have it hook into Windows to monitor all keystrokes (I'm not sure how to do that part, exactly) and then show a form when the user presses a particular sequence of keys.
So in other words, your application would have to be running from the time Windows starts, but only show itself (make a form visible) when the user clicks a particular key sequence.
Update: here is a link to an article that discusses how to do global keystroke capture using C#: http://blogs.msdn.com/toub/archive/2006/05/03/589423.aspx.

Resources