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
@@ -166,13 +166,6 @@ class ImageCanvasState extends State<ImageCanvas> {
|
||||
bool _onHardwareKey(KeyEvent event) {
|
||||
final key = event.logicalKey;
|
||||
if (event is KeyDownEvent) {
|
||||
if (key == LogicalKeyboardKey.keyR &&
|
||||
!HardwareKeyboard.instance.isControlPressed &&
|
||||
!HardwareKeyboard.instance.isShiftPressed &&
|
||||
!HardwareKeyboard.instance.isAltPressed) {
|
||||
_toggleFlipH();
|
||||
return true;
|
||||
}
|
||||
if (key == LogicalKeyboardKey.controlLeft ||
|
||||
key == LogicalKeyboardKey.controlRight) {
|
||||
_ctrlPressed = true;
|
||||
@@ -224,8 +217,8 @@ class ImageCanvasState extends State<ImageCanvas> {
|
||||
_markRenderDirty();
|
||||
}
|
||||
|
||||
/// R: sağ çift tık gibi efektleri sıfırlar ve yatay aynalar; tekrar basınca geri alır.
|
||||
void _toggleFlipH() {
|
||||
/// Ctrl+R: sağ çift tık gibi efektleri sıfırlar ve yatay aynalar; tekrar basınca geri alır.
|
||||
void toggleFlipH() {
|
||||
_flipH = !_flipH;
|
||||
_angle = 0; _contrast = 1.0; _saturation = 1.0; _brightness = 0;
|
||||
_interactionMode = 'none';
|
||||
|
||||
Reference in new issue
Block a user