You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
30 lines
529 B
30 lines
529 B
package mightypork.gamecore.input;
|
|
|
|
|
|
import mightypork.gamecore.gui.Action;
|
|
|
|
|
|
/**
|
|
* Can bind events to keys.
|
|
*
|
|
* @author MightyPork
|
|
*/
|
|
public interface KeyBinder {
|
|
|
|
/**
|
|
* Bind handler to a keystroke, replace current handler if any
|
|
*
|
|
* @param stroke trigger keystroke
|
|
* @param task handler; can be {@link Runnable} or {@link Action}
|
|
*/
|
|
void bindKey(KeyStroke stroke, Runnable task);
|
|
|
|
|
|
/**
|
|
* Remove handler from a keystroke (id any)
|
|
*
|
|
* @param stroke stroke
|
|
*/
|
|
void unbindKey(KeyStroke stroke);
|
|
|
|
}
|
|
|