List of usage examples for javafx.scene Node addEventFilter
public final <T extends Event> void addEventFilter(final EventType<T> eventType, final EventHandler<? super T> eventFilter)
From source file:org.noroomattheinn.visibletesla.App.java
/** * Begin watching for user inactivity (keyboard input, mouse movements, etc.) * on any of the specified Tabs.//from w w w.java2s. c o m * @param tabs Watch for user activity targeted to any of these tabs. */ void watchForUserActivity(List<Tab> tabs) { for (Tab t : tabs) { Node n = t.getContent(); n.addEventFilter(KeyEvent.ANY, new EventPassThrough()); n.addEventFilter(MouseEvent.MOUSE_PRESSED, new EventPassThrough()); n.addEventFilter(MouseEvent.MOUSE_RELEASED, new EventPassThrough()); } ThreadManager.get().launch(new InactivityThread(60L * 1000L * prefs.idleThresholdInMinutes.get()), "Inactivity"); }