RxJavaFX icon indicating copy to clipboard operation
RxJavaFX copied to clipboard

Support scene accelerators

Open cebaa opened this issue 6 years ago • 4 comments

A shortcut for this:

Observable.generate(emitter -> {
         scene.getAccelerators().put(new KeyCharacterCombination("c"),
            () -> emitter.onNext(true));
      });

cebaa avatar Mar 12 '19 22:03 cebaa

Can you put in a PR, thanks!

thomasnield avatar Mar 13 '19 17:03 thomasnield

What kind of shortcut do you want to see as result? val keyCharObservable = eventsOf(scene, EventType<KeyCharacterCombination, "c">)?

rcd27 avatar Mar 14 '19 03:03 rcd27

@rcd27

Since the signature is:

public ObservableMap<KeyCombination,Runnable> getAccelerators()

so maybe something like this:

val keyCharObservable = withAccelerator(scene, new KeyCharacterCombination("c"))

cebaa avatar Mar 14 '19 13:03 cebaa

@thomasnield I think I'm able to do that

rcd27 avatar Mar 14 '19 14:03 rcd27