natros / gwt-cal

Automatically exported from code.google.com/p/gwt-cal
0 stars 2 forks source link

Allow adding Key*Handlers #135

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
Description of the new feature:
Currently you cannot add your own keyboard listeners, since the events for keys 
are captured on a focus panel hidden inside the InteractiveWidget class.
Allowing users to add keyboard listeners will enable things like copy/paste.

Use Case:
* developer registers key listeners on calendar
* user selects an appointment
* user presses ctrl-c
* developers code copies selected appointment to a temporary variable
* user presses ctrl-v
* developers code clones the appointment and adds it to the calender
* user moves event to any other location by DnD

Code / psuedo-code:
add these lines to InteractiveWidget:

    public void addKeyDownHandler(KeyDownHandler handler) {
        focusPanel.addKeyDownHandler(handler);
    }

    public void addKeyUpHandler(KeyUpHandler handler) {
        focusPanel.addKeyUpHandler(handler);
    }

    public void addKeyPressHandler(KeyPressHandler handler) {
        focusPanel.addKeyPressHandler(handler);
    }

Original issue reported on code.google.com by thomas.d...@gmail.com on 6 Oct 2011 at 8:32