Rogue: Savage Rats, a retro-themed dungeon crawler
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.
 
 
rogue-savage-rats/src/mightypork/gamecore/input/KeyBinder.java

31 lines
590 B

package mightypork.gamecore.input;
import mightypork.gamecore.gui.Action;
/**
* Can bind events to keys.
*
* @author Ondřej Hruška (MightyPork)
*/
public interface KeyBinder {
/**
* Bind handler to a keystroke, replace current handler if any
*
* @param edge trigger edge
* @param stroke trigger keystroke
* @param task handler; can be {@link Runnable} or {@link Action}
*/
void bindKey(KeyStroke stroke, Trigger edge, Runnable task);
/**
* Remove handler from a keystroke (id any)
*
* @param stroke stroke
*/
void unbindKey(KeyStroke stroke);
}