The Artima Developer Community
Sponsored Link

Java Answers Forum
creating a virtual key

4 replies on 1 page. Most recent reply: May 11, 2005 11:07 PM by Matthias Neumair

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 4 replies on 1 page
Nony Nonomino

Posts: 3
Nickname: palomint
Registered: May, 2005

creating a virtual key Posted: May 4, 2005 11:31 PM
Reply to this message Reply
Advertisement
I'm understand Java basics, but I'm trying to do something more complex, and I don't know where to begin.

I want to define my own special key (call it F13), as if it were a regular key on the keyboard. I'm prepared to dive into key bindings, but I thought I might need to know how to make my key first.

Any help is greatly appreciated.


Nony Nonomino

Posts: 3
Nickname: palomint
Registered: May, 2005

Re: creating a virtual key Posted: May 8, 2005 9:55 PM
Reply to this message Reply
No tips at all? I'll take anything at this point.

Matthias Neumair

Posts: 660
Nickname: neumi
Registered: Sep, 2003

Re: creating a virtual key Posted: May 10, 2005 1:46 AM
Reply to this message Reply
I'm not exactly sure what you want to accomplish or why.

You can fire key events with any unicode character.
There are 65000 of them, many unused, so you should not have any problems using one of them.

But: Why do you want a key listener for a key that can't be typed?

Nony Nonomino

Posts: 3
Nickname: palomint
Registered: May, 2005

Re: creating a virtual key Posted: May 11, 2005 3:12 PM
Reply to this message Reply
That's a good question. Here's my answer.

I'm creating (hopefully) a program that will assist a visually impaired user in navigating an operating system. When the user presses a button on a braille keyboard, a voice announces what key has been pressed, and that key functions normally. When a standard key is pressed in conjunction with my virtual key, a menu pops up, from which the user can select commands that begin with the key that was pressed.

Assume we call the key DBA, for Database. DBA + a would bring up a menu that lists all the commands beginning with a, and the user could cycle through them to get to what they want.

I realize I have miles of work to go, but I need to start somewhere. Thanks for your help.

Matthias Neumair

Posts: 660
Nickname: neumi
Registered: Sep, 2003

Re: creating a virtual key Posted: May 11, 2005 11:07 PM
Reply to this message Reply
From what I understood you want to create some sort of filter.
Instead of showing all commands beginning with 'a', you want to show only those commands wich are in the category of the pressed key.

So your "virtual" key DOES exist (or do you want to build a keyboard with this key), right?
I mean, SOMEONE has to press this key ...
In this case you will get a KeyPressed Event with the code of the key, depending on your keyboard driver.

I would say that you better go for modifiers instead of virtual keys.

The key event contains a modifier wich tells you if SHIFT or ALT or whatever is pressed.

I would say that you should try to create a modifier for your virtual key.

I don't think it will work if you extend the key event class, but you should modify it's source code and override it (don't overwrite the original .class file, but put the path to your modified class at the beginning of your classpath, also do this in your IDE).


Another question: Since you seem to have some experience with the work for visually impaired users: A friend of mine has heavy problems, too (he only sees with the upper right corner of his eye). So he has problems reading SMS on his cell phone. The new generations have much better displays, but it still is not easy. Do you know a SMS client with a bigger or resizable font? It's for a Nokia 6600, so a Java program would work fine.
I don't have any experience with Java midlet, so my attempts to write something did not produce any results.

Flat View: This topic has 4 replies on 1 page
Topic: Java and Ms Access database integrating together Previous Topic   Next Topic Topic: TIJ Example c08:Callbacks.java

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use