Update use of input display by petebankhead · Pull Request #2033 · qupath/qupath

Draft PR to explore the changes introduces in qupath/qupath-fxtras#63

If accepted, then a new release of qupath-fxtras should be made (this currently uses a snapshot).

The main change is that the input display now makes key presses visible for longer, having them gentle fade out rather than disappear immediately after keys are released.

This is actually really fiddly to try to get behaving well, because a combination like Ctrl + Shift + C corresponds to multiple events, and so there needs to be some kind of 'memory' to avoid retaining only the last key that was released.

Changes to behavior would need to be made in qupath-fxtras.

There are also some new options for InputDisplay, which can be controlled via scripting:

guiscript=true

var id = getQuPath().getInputDisplay()
id.show()

// New properties
id.setShowSymbols(false) // Unicode keyboard symbols (where known)
id.setFadeTo(0.5)        // Opacity of keypresses after fading
id.setFadeDuration(javafx.util.Duration.millis(1000)) // Duration of fade
id.setSkipTextInputControls(true) // Don't show keypresses in text controls
                                  // (the script editor ignores this...)