Skip to content

Commit

Permalink
Fix some minor issues
Browse files Browse the repository at this point in the history
Fix cursor highlight position under 4K display
Fixes for key triggered labels not displaying correctly including ` and =
  • Loading branch information
Ansen-A committed Sep 28, 2023
1 parent d6fef04 commit 95f69c7
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 6 deletions.
8 changes: 4 additions & 4 deletions lib/domain/services/key_maps.dart
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,7 @@ final keymaps = <int, KeyMapData>{
glyph: "⎋",
icon: KeyIcons.escape,
),
LogicalKeyboardKey.tilde.keyId: const KeyMapData(
LogicalKeyboardKey.backquote.keyId: const KeyMapData(
label: "`",
symbol: "~",
),
Expand Down Expand Up @@ -262,7 +262,7 @@ final keymaps = <int, KeyMapData>{
label: "-",
symbol: "_",
),
LogicalKeyboardKey.add.keyId: const KeyMapData(
LogicalKeyboardKey.equal.keyId: const KeyMapData(
label: "=",
symbol: "+",
),
Expand Down Expand Up @@ -351,12 +351,12 @@ final keymaps = <int, KeyMapData>{
symbol: "pg up",
),
leftClickId: const KeyMapData(
label: "click",
label: "left click",
icon: KeyIcons.leftClick,
),
rightClickId: const KeyMapData(
label: "right click",
shortLabel: "click",
// shortLabel: "click",
icon: KeyIcons.rightClick,
),
dragId: const KeyMapData(
Expand Down
9 changes: 7 additions & 2 deletions lib/windows/mouse_visualizer/mouse_visualizer.dart
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,15 @@ class MouseVisualizer extends StatelessWidget {
Widget build(BuildContext context) {
return Selector<KeyEventProvider, Tuple2<bool, Offset>>(
builder: (context, tuple, child) {
final devicePixelRatio = MediaQuery.of(context)
.devicePixelRatio; // Get the logical pixel ratio

return tuple.item1
? Positioned(
left: tuple.item2.dx,
top: tuple.item2.dy,
left: tuple.item2.dx /
devicePixelRatio, // Horizontal offset of the cursor divided by the logical pixel ratio
top: tuple.item2.dy /
devicePixelRatio, // The vertical offset of the cursor divided by the logical pixel ratio
child: const IgnorePointer(
child: FractionalTranslation(
translation: Offset(-.5, -.5),
Expand Down

0 comments on commit 95f69c7

Please sign in to comment.