Example usage for javafx.scene.input ScrollEvent getEventType

List of usage examples for javafx.scene.input ScrollEvent getEventType

Introduction

In this page you can find the example usage for javafx.scene.input ScrollEvent getEventType.

Prototype

@Override
    public EventType<ScrollEvent> getEventType() 

Source Link

Usage

From source file:Main.java

public static java.awt.event.KeyEvent toAwt(final ScrollEvent event) {
    final EventType type = event.getEventType();
    if (null == type) {
        return null;
    }/*from w  w  w  .j a v  a 2s.c o m*/

    final long when = -1;
    final int id = java.awt.event.KeyEvent.KEY_PRESSED;
    final int keyCode;
    if (event.getDeltaY() > 0) {
        keyCode = java.awt.event.KeyEvent.VK_PAGE_DOWN;
    } else {
        keyCode = java.awt.event.KeyEvent.VK_PAGE_UP;
    }
    final int modifiers = modifiers(event);
    final char keyChar = ' ';
    return new java.awt.event.KeyEvent(empty, id, when, modifiers, keyCode, keyChar);
}