Search in sources :

Example 1 with AbstractTriggerCommand

use of de.mossgrabers.framework.command.core.AbstractTriggerCommand in project DrivenByMoss by git-moss.

the class AbstractView method simulateButtonPress.

/**
 * Simulate pressing a button by sending a button down and up event.
 *
 * @param buttonID The ID of the button to trigger
 */
protected void simulateButtonPress(final ButtonID buttonID) {
    final IHwButton button = this.surface.getButton(buttonID);
    final AbstractTriggerCommand<?, ?> triggerCommand = (AbstractTriggerCommand<?, ?>) button.getCommand();
    triggerCommand.executeNormal(ButtonEvent.DOWN);
    triggerCommand.executeNormal(ButtonEvent.UP);
}
Also used : AbstractTriggerCommand(de.mossgrabers.framework.command.core.AbstractTriggerCommand) IHwButton(de.mossgrabers.framework.controller.hardware.IHwButton)

Example 2 with AbstractTriggerCommand

use of de.mossgrabers.framework.command.core.AbstractTriggerCommand in project DrivenByMoss by git-moss.

the class AbstractView method simulateShiftedButtonPress.

/**
 * Simulate pressing a button with combination of the shift button by sending a button down and
 * up event.
 *
 * @param buttonID The ID of the button to trigger
 */
protected void simulateShiftedButtonPress(final ButtonID buttonID) {
    final IHwButton button = this.surface.getButton(buttonID);
    final AbstractTriggerCommand<?, ?> triggerCommand = (AbstractTriggerCommand<?, ?>) button.getCommand();
    triggerCommand.executeShifted(ButtonEvent.DOWN);
    triggerCommand.executeShifted(ButtonEvent.UP);
}
Also used : AbstractTriggerCommand(de.mossgrabers.framework.command.core.AbstractTriggerCommand) IHwButton(de.mossgrabers.framework.controller.hardware.IHwButton)

Aggregations

AbstractTriggerCommand (de.mossgrabers.framework.command.core.AbstractTriggerCommand)2 IHwButton (de.mossgrabers.framework.controller.hardware.IHwButton)2