Skip to content

Commit

Permalink
Win: Stop F10 from changing KB focus to sys menu
Browse files Browse the repository at this point in the history
I'm not sure when Windows 10 started hijacking the F10 key to serve the
same purpose as the left Alt key (activating the system menu), but it
must have been recently.  (In the process of integrating/implementing
the server-side key mapping feature in TurboVNC 3.1, I thoroughly tested
all possible keystrokes on Windows, macOS, and Linux clients.)

This commit simply extends the fix in
4d40722 to cover the F10 key as well.
  • Loading branch information
dcommander committed Jan 17, 2024
1 parent a4e8da2 commit e787d55
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
5 changes: 5 additions & 0 deletions ChangeLog.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,11 @@ is already using Display :1. The previous behavior can be restored by passing
associated with an X display number is in use before assuming that the display
number is available.

6. Fixed an issue in the Windows TurboVNC Viewer whereby an F10 key press,
followed by an F10 key release, caused the keyboard focus to be redirected to
the system menu, and subsequent keystrokes were consumed by the system menu
until F10, left Alt, or Esc was pressed to dismiss the menu.


3.0.3
=====
Expand Down
7 changes: 4 additions & 3 deletions java/com/turbovnc/vncviewer/DesktopWindow.java
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/* Copyright (C) 2010, 2012-2013, 2015-2018, 2020-2023 D. R. Commander.
/* Copyright (C) 2010, 2012-2013, 2015-2018, 2020-2024 D. R. Commander.
* All Rights Reserved.
* Copyright (C) 2011-2013 Brian P. Hinz
* Copyright (C) 2009 Paul Donohue. All Rights Reserved.
Expand Down Expand Up @@ -99,8 +99,9 @@ class DesktopWindow extends JPanel implements Runnable, MouseListener,
private final KeyEventDispatcher keyEventDispatcher =
new KeyEventDispatcher() {
public boolean dispatchKeyEvent(KeyEvent e) {
if (e.getKeyCode() == 18 &&
e.getKeyLocation() == KeyEvent.KEY_LOCATION_LEFT) {
if ((e.getKeyCode() == 18 &&
e.getKeyLocation() == KeyEvent.KEY_LOCATION_LEFT) ||
e.getKeyCode() == 121) {
if (e.getID() == KeyEvent.KEY_PRESSED)
cc.desktop.keyPressed(e);
else if (e.getID() == KeyEvent.KEY_RELEASED)
Expand Down

0 comments on commit e787d55

Please sign in to comment.