<AWT Dev> creating an ActionEvent with modifiers from an InputEvent
javalists at cbfiddle.com
Mon Oct 29 19:29:06 UTC 2018
No, that would require ActionEvent to accept extended modifiers.
> On Oct 29, 2018, at 3:03 AM, Denis Fokin <denis.fokin at gmail.com> wrote:
> Hi Alan,
> according to the new JavaDoc "It is recommended that extended modifier keys and getModifiersEx() be used instead". Does this method suit your needs?
> Thank you,
> On Sun, Oct 28, 2018 at 11:33 PM Alan Snyder <javalists at cbfiddle.com <mailto:javalists at cbfiddle.com>> wrote:
> ActionEvent defines four modifier bits for SHIFT, CTRL, META, and ALT that coincidentally (not really, but distinct static variables are used, so how would one know for sure?) match modifier bits defined by InputEvent/Event. Oddly, the latter modifier bits were deprecated in JDK 9, as was the method to fetch them.
> So, what is the correct way to create an ActionEvent with modifier bits extracted from an InputEvent?
> There are many examples in the JDK where this is done, and they all use the deprecated method InputEvent.getModifiers().
> Is there a recommended alternative?
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the awt-dev