mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
[terminal] IJPL-212018 do not send SCROLLUP mouse event for scroll events with wheelRotation = 0
This fixes for 'Reworked 2025' terminal. For 'Classic' terminal, it was fixed by https://jetbrains.team/p/ij/repositories/jediterm/revision/fb0f77c7ea2b611c2d666afe8d2821a7fe5a6140 GitOrigin-RevId: 5d12b683cf815ace8263079edd3e09b1c3193914
This commit is contained in:
committed by
intellij-monorepo-bot
parent
e2ee08973d
commit
560b322ea0
+11
-3
@@ -313,13 +313,21 @@ internal open class TerminalEventsHandlerImpl(
|
||||
return when {
|
||||
SwingUtilities.isLeftMouseButton(event) -> MouseButtonCodes.LEFT
|
||||
SwingUtilities.isMiddleMouseButton(event) -> MouseButtonCodes.MIDDLE
|
||||
SwingUtilities.isRightMouseButton(
|
||||
event) -> MouseButtonCodes.NONE //we don't handle right mouse button as it used for the context menu invocation
|
||||
event is MouseWheelEvent -> if (event.wheelRotation > 0) MouseButtonCodes.SCROLLUP else MouseButtonCodes.SCROLLDOWN
|
||||
SwingUtilities.isRightMouseButton(event) -> {
|
||||
// we don't handle the right mouse button as it used for the context menu invocation
|
||||
MouseButtonCodes.NONE
|
||||
}
|
||||
event is MouseWheelEvent -> wheelRotationToButtonCode(event.wheelRotation)
|
||||
else -> return MouseButtonCodes.NONE
|
||||
}
|
||||
}
|
||||
|
||||
private fun wheelRotationToButtonCode(wheelRotation: Int): Int = when {
|
||||
wheelRotation > 0 -> MouseButtonCodes.SCROLLUP
|
||||
wheelRotation < 0 -> MouseButtonCodes.SCROLLDOWN
|
||||
else -> MouseButtonCodes.NONE
|
||||
}
|
||||
|
||||
private fun applyModifierKeys(event: MouseEvent, cb: Int): Int {
|
||||
var code = cb
|
||||
if (event.isControlDown) {
|
||||
|
||||
Reference in New Issue
Block a user