All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.flash3388.flashlib.hid.Dpad Maven / Gradle / Ivy

package com.flash3388.flashlib.hid;

import java.util.Arrays;

/**
 * Represents a Direction Pad on a Human Interface Device.
 * 

* A DPad is a specialized {@link Pov} limited to specific direction: up, down, left right * and combinations between them. * * It returns a degree value from 0 to 360 indicating direction, where: *

*
    *
  • Up = 360/0
  • *
  • Down = 180
  • *
  • Right = 90
  • *
  • Left = 270
  • *
*

* Several direction may be active at the same time, if they do not cancel each other. This will be indicated * in {@link #getAsInt()} by a direction which is in the middle of both. *

* * @since FlashLib 3.0.0 */ public interface Dpad extends Pov { /** * Gets the button representation of the up direction. This button * will be considered active when the {@link #getAsInt()} value * represents the upwards direction. * * @return a {@link Button} representing UP. */ Button up(); /** * Gets the button representation of the down direction. This button * will be considered active when the {@link #getAsInt()} value * represents the upwards direction. * * @return a {@link Button} representing DOWN. */ Button down(); /** * Gets the button representation of the left direction. This button * will be considered active when the {@link #getAsInt()} value * represents the upwards direction. * * @return a {@link Button} representing LEFT. */ Button left(); /** * Gets the button representation of the right direction. This button * will be considered active when the {@link #getAsInt()} value * represents the upwards direction. * * @return a {@link Button} representing RIGHT. */ Button right(); /** * Gets all the button representations of the directions of the DPad. * This includes: up, down, left, and right. * * @return up, down, left, and right buttons. */ default Iterable




© 2015 - 2025 Weber Informatics LLC | Privacy Policy