Class ClickEventEnabler



  • public class ClickEventEnabler
    extends Object
    This class lets mouseClicked events be triggered even if the mouse moves a few pixels.

    By default Java only triggers mouseClicked messages when the mouse doesn't move between mousePressed and mouseReleased. Trackpads and touchpads, however, are less precise: as they grow in numbers, we need to allow a few extra pixels to trigger a mouseClicked event.

    • Field Detail

      • CLICK_EVENT_TOLERANCE

        public static double CLICK_EVENT_TOLERANCE
        The distance between the point where the mouse is pressed and where it is released that is allowed to constitute a "click".

        Java by default effectively gives you a 0-pixel tolerance. The field is initialized to 10, but you're welcome to change it as needed.

      • printSecurityExceptionOnlyOnce

        public static boolean printSecurityExceptionOnlyOnce
    • Constructor Detail

      • ClickEventEnabler

        public ClickEventEnabler()
    • Method Detail

      • install

        public static boolean install()