fix: Ctrl+R flip also matches the physical R key (v1.6.1)
On some keymaps the R key resolves to a different logical key (observed on a Turkish remote-desktop setup: the R key arrives as logical T), so the Ctrl+R shortcut never fired even though the key events reached the app. The shortcut now matches PhysicalKeyboardKey.keyR as well; a regression test covers the wrong-layout case.
This commit is contained in:
1 parent
bad48167c8
commit
6e13892ed1
14 files changed
+98
-35
No files matched your search
@@ -8,8 +8,14 @@ import '../services/file_handler.dart';
|
||||
class AppShortcuts extends StatelessWidget {
|
||||
final Widget child;
|
||||
final VoidCallback? onCropSave;
|
||||
final VoidCallback? onFlipH;
|
||||
|
||||
const AppShortcuts({super.key, required this.child, this.onCropSave});
|
||||
const AppShortcuts({
|
||||
super.key,
|
||||
required this.child,
|
||||
this.onCropSave,
|
||||
this.onFlipH,
|
||||
});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
@@ -44,6 +50,17 @@ class AppShortcuts extends StatelessWidget {
|
||||
}
|
||||
}
|
||||
|
||||
// Ctrl+R: yatay aynala / geri al (fiziksel R: bazi klavye haritalarinda
|
||||
// mantiksal tus T gibi farkli cozuluyor)
|
||||
if (ctrl &&
|
||||
(event.logicalKey == LogicalKeyboardKey.keyR ||
|
||||
event.physicalKey == PhysicalKeyboardKey.keyR)) {
|
||||
if (onFlipH != null) {
|
||||
onFlipH!();
|
||||
return KeyEventResult.handled;
|
||||
}
|
||||
}
|
||||
|
||||
switch (event.logicalKey) {
|
||||
case LogicalKeyboardKey.arrowLeft:
|
||||
ImageManager.instance.previousImage();
|
||||
|
||||
Reference in new issue
Block a user