F
Francois Lionet
Hello all,
In my game, I have an JTextField flying above the playfield.
When the user has selected the textfield and types some text in it, the keys
are no longuer transmitted to the main application. But I need them!
I have tried to addKeyListener(myApplication), but if I do this, the key
events get stuck in the application, and are not anymore transmitted to the
text field.
In the doc, I see a "consume" field that indicates if the event should carry
on the list of listener. As it is protected I do not know what to do. I
wanted to make a subclass of keyevent and access the consumer like this, but
the problem is that many of the fields wanted by the constructor of keyevent
are unaccessible.
Can you help me and give me an idea on how to transmit the keys to the
application even when the TextField has the focus?
Thanks, Francois
In my game, I have an JTextField flying above the playfield.
When the user has selected the textfield and types some text in it, the keys
are no longuer transmitted to the main application. But I need them!
I have tried to addKeyListener(myApplication), but if I do this, the key
events get stuck in the application, and are not anymore transmitted to the
text field.
In the doc, I see a "consume" field that indicates if the event should carry
on the list of listener. As it is protected I do not know what to do. I
wanted to make a subclass of keyevent and access the consumer like this, but
the problem is that many of the fields wanted by the constructor of keyevent
are unaccessible.
Can you help me and give me an idea on how to transmit the keys to the
application even when the TextField has the focus?
Thanks, Francois