[prev in list] [next in list] [prev in thread] [next in thread] 

List:       openjdk-openjfx-dev
Subject:    Best way to block KeyEvent
From:       lubomir.nerad () oracle ! com (Lubomir Nerad)
Date:       2012-06-28 11:08:35
Message-ID: 4FEC3B33.7060808 () oracle ! com
[Download RAW message or body]

Ahoj Jiri :-),

I am Slovak, so it's not my name day quite yet.  But thanks anyway.

Lubo

On 6/28/2012 11:36 AM, goddard at seznam.cz wrote:
> Thanks, and happy name day :)
> http://www.slate.com/blogs/future_tense/2012/06/27/_back_to_the_future_future_day_hoax_today_not_the_date_shown_on_doc_s_delorean.html \
>  
> 
> Jiri
> 
> ------------ P?vodn? zpr?va ------------
> Od: Lubomir Nerad <lubomir.nerad at oracle.com>
> P?edm?t: Re: Best way to block KeyEvent
> Datum: 27.6.2012 18:12:55
> ----------------------------------------
> Hi Jiri,
> 
> you can consume key events for blocked keys in an event filter. Event 
> filter is an EventHandler registered through addEventFilter method. It 
> can be registered directly on the focused node or on any of its parent 
> nodes, scene or stage.
> 
> Example:
> 
> node.addEventFilter(KeyEvent.KEY_PRESSED,
> new EventHandler<KeyEvent>() {
> public void handle(KeyEvent keyEvent) {
> if (<key test>) {
> keyEvent.consume();
> }
> }
> });
> 
> For <key test> you can use the KeyCombination.match method.
> 
> Regards,
> Lubo
> 
> On 6/27/2012 5:28 PM, goddard at seznam.cz wrote:
> > Hello,
> > 
> > what's the best way to block KeyEvent? Let's say I want to have 
> > "enabled" only
> one key at a time in a set of keys.
> > 
> > Regards, Jiri
> 
> 


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic