RFR: 8204 : Keyboard traps in flamegraph view for search option [v2]
Brice Dutheil
bdutheil at openjdk.org
Wed Feb 28 10:49:52 UTC 2024
On Tue, 27 Feb 2024 16:52:11 GMT, Virag Purnam <vpurnam at openjdk.org> wrote:
>> application/org.openjdk.jmc.flightrecorder.flamegraph/src/main/java/org/openjdk/jmc/flightrecorder/flamegraph/views/FlamegraphSwingView.java line 688:
>>
>>> 686: public void keyPressed(KeyEvent e) {
>>> 687: if (e.getKeyCode() == KeyEvent.VK_TAB) {
>>> 688: if (e.getModifiersEx() > 0) {
>>
>> **suggestion:** `e.getModifiersEx() > 0` comes up a lot, I believe the idea here is to handle <kbd>Shift</kbd> <kbd>Tab</kbd>, I believe it's the same on all OSes. Might be worth extracting this as util method.
>
> Extracted a method and added comment.
I think I would prefer something like
Suggestion:
if (e.getModifiersEx() & InputEvent.SHIFT_DOWN_MASK) != 0) {
-------------
PR Review Comment: https://git.openjdk.org/jmc/pull/554#discussion_r1505743526
More information about the jmc-dev
mailing list