Internal
Public Access
Fix RDP key repeat: forward auto-repeat presses to the remote server
RdpDisplayWidget::keyPressEvent() dropped every event where QKeyEvent::isAutoRepeat() was true, which discards the entire repeat stream Qt generates while a key is held -- so holding a key only ever produced a single keystroke on the remote machine. Auto-repeat presses need to reach the remote server so it can perform its own typematic repeat, exactly as a physical keyboard held down would; only release events should filter isAutoRepeat() (kept as-is), since Qt uses a synthetic release/press pair purely to normalize platform auto-repeat quirks, and forwarding that synthetic release would send a spurious key-up for a key still physically held. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
@@ -147,10 +147,16 @@ void RdpDisplayWidget::resizeEvent(QResizeEvent* event)
|
||||
|
||||
void RdpDisplayWidget::keyPressEvent(QKeyEvent* event)
|
||||
{
|
||||
if (event == nullptr || event->isAutoRepeat()) {
|
||||
if (event == nullptr) {
|
||||
return;
|
||||
}
|
||||
|
||||
// Auto-repeat presses must reach the remote server so it can perform
|
||||
// its own typematic repeat, exactly as a physical keyboard held down
|
||||
// would. Only release events filter out isAutoRepeat() (below), since
|
||||
// Qt uses a synthetic release/press pair purely to normalize platform
|
||||
// auto-repeat quirks -- forwarding that synthetic release would send a
|
||||
// spurious key-up for a key that is still physically held.
|
||||
emit keyInput(event->key(),
|
||||
event->nativeScanCode(),
|
||||
event->text(),
|
||||
|
||||
Reference in New Issue
Block a user