From f3dae6fb484ee05aa21aa08d9e2c80ecf25e7df4 Mon Sep 17 00:00:00 2001 From: Jonas Bark Date: Thu, 9 Oct 2025 13:52:18 +0200 Subject: [PATCH] rebuild --- .github/workflows/build.yml | 2 +- lib/pages/touch_area.dart | 267 +++++++++++++++++------------------- 2 files changed, 128 insertions(+), 141 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 05e8473..6462379 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -198,7 +198,7 @@ jobs: API_KEY_BASE64: ${{ secrets.APPSTORE_API_KEY_FILE_BASE64 }} run: | mkdir -p ./private_keys; - printf %s "$API_KEY_BASE64" | base64 -D > "./private_keys/AuthKey_${APPSTORE_API_ISSUER_ID}.p8"; + printf %s "$API_KEY_BASE64" | base64 -D > "./private_keys/AuthKey_${APPSTORE_API_KEY}.p8"; ls -lart ./private_keys; flutter build ipa --release --export-options-plist=ios/ExportOptions.plist; xcrun altool --upload-app -f build/ios/ipa/swift_play.ipa -t ios --apiKey "$APPSTORE_API_KEY" --apiIssuer "$APPSTORE_API_ISSUER_ID"; diff --git a/lib/pages/touch_area.dart b/lib/pages/touch_area.dart index a767d8e..c981f61 100644 --- a/lib/pages/touch_area.dart +++ b/lib/pages/touch_area.dart @@ -182,154 +182,141 @@ class _TouchAreaSetupPageState extends State { final isOnTheRightEdge = position.dx > (MediaQuery.sizeOf(context).width - 250); final iconSize = 40.0; - final icon = Row( - children: [ - Container( - decoration: BoxDecoration( - color: color.withOpacity(0.4), - shape: BoxShape.circle, - border: Border.all(color: Colors.white, width: 2), - ), - width: iconSize, - height: iconSize, - child: Icon( - keyPair.icon, - size: iconSize - 12, - shadows: [ - Shadow(color: Colors.white, offset: Offset(1, 1)), - Shadow(color: Colors.white, offset: Offset(-1, -1)), - Shadow(color: Colors.white, offset: Offset(-1, 1)), - Shadow(color: Colors.white, offset: Offset(-1, 1)), - Shadow(color: Colors.white, offset: Offset(1, -1)), - ], - ), + final draggable = [ + Container( + decoration: BoxDecoration( + color: color.withOpacity(0.4), + shape: BoxShape.circle, + border: Border.all(color: Colors.white, width: 2), ), - FractionalTranslation( - translation: Offset(isOnTheRightEdge ? -1.0 : 0.0, 0), - child: Row( - spacing: 2, - children: [ - KeypairExplanation(withKey: true, keyPair: keyPair), - PopupMenuButton( - enabled: enableTouch, - itemBuilder: - (context) => [ - PopupMenuItem( - value: null, - child: ListTile( - leading: Icon(Icons.keyboard_alt_outlined), - title: const Text('Simulate Keyboard shortcut'), - ), - onTap: () async { - await showDialog( - context: context, - barrierDismissible: false, // enable Escape key - builder: - (c) => HotKeyListenerDialog( - customApp: actionHandler.supportedApp! as CustomApp, - keyPair: keyPair, - ), - ); - setState(() {}); - }, - ), - PopupMenuItem( - value: null, - child: ListTile(title: const Text('Simulate Touch'), leading: Icon(Icons.touch_app_outlined)), - onTap: () { - keyPair.physicalKey = null; - keyPair.logicalKey = null; - setState(() {}); - }, - ), - PopupMenuItem( - value: null, - onTap: () { - keyPair.isLongPress = !keyPair.isLongPress; - setState(() {}); - }, - child: CheckboxListTile( - value: keyPair.isLongPress, - onChanged: (value) { - keyPair.isLongPress = value ?? false; - setState(() {}); - Navigator.of(context).pop(); - }, - title: const Text('Long Press Mode (vs. repeating)'), - ), - ), - PopupMenuDivider(), - PopupMenuItem( - child: PopupMenuButton( - padding: EdgeInsets.zero, - itemBuilder: - (context) => [ - PopupMenuItem( - value: PhysicalKeyboardKey.mediaPlayPause, - child: const Text('Media: Play/Pause'), - ), - PopupMenuItem( - value: PhysicalKeyboardKey.mediaStop, - child: const Text('Media: Stop'), - ), - PopupMenuItem( - value: PhysicalKeyboardKey.mediaTrackPrevious, - child: const Text('Media: Previous'), - ), - PopupMenuItem( - value: PhysicalKeyboardKey.mediaTrackNext, - child: const Text('Media: Next'), - ), - PopupMenuItem( - value: PhysicalKeyboardKey.audioVolumeUp, - child: const Text('Media: Volume Up'), - ), - PopupMenuItem( - value: PhysicalKeyboardKey.audioVolumeDown, - child: const Text('Media: Volume Down'), - ), - ], - onSelected: (key) { - keyPair.physicalKey = key; - keyPair.logicalKey = null; - - setState(() {}); - }, - child: ListTile( - leading: Icon(Icons.music_note_outlined), - trailing: Icon(Icons.arrow_right), - title: Text('Simulate Media key'), - ), - ), - ), - PopupMenuDivider(), - PopupMenuItem( - value: null, - child: ListTile( - title: const Text('Delete Keymap'), - leading: Icon(Icons.delete, color: Colors.red), - ), - onTap: () { - actionHandler.supportedApp!.keymap.keyPairs.remove(keyPair); - setState(() {}); - }, - ), - ], - onSelected: (key) { - keyPair.physicalKey = key; + width: iconSize, + height: iconSize, + child: Icon( + keyPair.icon, + size: iconSize - 12, + shadows: [ + Shadow(color: Colors.white, offset: Offset(1, 1)), + Shadow(color: Colors.white, offset: Offset(-1, -1)), + Shadow(color: Colors.white, offset: Offset(-1, 1)), + Shadow(color: Colors.white, offset: Offset(-1, 1)), + Shadow(color: Colors.white, offset: Offset(1, -1)), + ], + ), + ), + PopupMenuButton( + enabled: enableTouch, + itemBuilder: + (context) => [ + PopupMenuItem( + value: null, + child: ListTile( + leading: Icon(Icons.keyboard_alt_outlined), + title: const Text('Simulate Keyboard shortcut'), + ), + onTap: () async { + await showDialog( + context: context, + barrierDismissible: false, // enable Escape key + builder: + (c) => + HotKeyListenerDialog(customApp: actionHandler.supportedApp! as CustomApp, keyPair: keyPair), + ); + setState(() {}); + }, + ), + PopupMenuItem( + value: null, + child: ListTile(title: const Text('Simulate Touch'), leading: Icon(Icons.touch_app_outlined)), + onTap: () { + keyPair.physicalKey = null; keyPair.logicalKey = null; setState(() {}); }, - child: Icon(Icons.more_vert), + ), + PopupMenuItem( + value: null, + onTap: () { + keyPair.isLongPress = !keyPair.isLongPress; + setState(() {}); + }, + child: CheckboxListTile( + value: keyPair.isLongPress, + onChanged: (value) { + keyPair.isLongPress = value ?? false; + setState(() {}); + Navigator.of(context).pop(); + }, + title: const Text('Long Press Mode (vs. repeating)'), + ), + ), + PopupMenuDivider(), + PopupMenuItem( + child: PopupMenuButton( + padding: EdgeInsets.zero, + itemBuilder: + (context) => [ + PopupMenuItem( + value: PhysicalKeyboardKey.mediaPlayPause, + child: const Text('Media: Play/Pause'), + ), + PopupMenuItem( + value: PhysicalKeyboardKey.mediaStop, + child: const Text('Media: Stop'), + ), + PopupMenuItem( + value: PhysicalKeyboardKey.mediaTrackPrevious, + child: const Text('Media: Previous'), + ), + PopupMenuItem( + value: PhysicalKeyboardKey.mediaTrackNext, + child: const Text('Media: Next'), + ), + PopupMenuItem( + value: PhysicalKeyboardKey.audioVolumeUp, + child: const Text('Media: Volume Up'), + ), + PopupMenuItem( + value: PhysicalKeyboardKey.audioVolumeDown, + child: const Text('Media: Volume Down'), + ), + ], + onSelected: (key) { + keyPair.physicalKey = key; + keyPair.logicalKey = null; + + setState(() {}); + }, + child: ListTile( + leading: Icon(Icons.music_note_outlined), + trailing: Icon(Icons.arrow_right), + title: Text('Simulate Media key'), + ), + ), + ), + PopupMenuDivider(), + PopupMenuItem( + value: null, + child: ListTile(title: const Text('Delete Keymap'), leading: Icon(Icons.delete, color: Colors.red)), + onTap: () { + actionHandler.supportedApp!.keymap.keyPairs.remove(keyPair); + setState(() {}); + }, ), ], - ), - ), - ], - ); + onSelected: (key) { + keyPair.physicalKey = key; + keyPair.logicalKey = null; + setState(() {}); + }, + child: Row(children: [KeypairExplanation(withKey: true, keyPair: keyPair), Icon(Icons.more_vert)]), + ), + ]; + + final icon = Row(children: isOnTheRightEdge ? draggable.reversed.toList() : draggable); return Positioned( - left: position.dx - iconSize / 2, + right: isOnTheRightEdge ? MediaQuery.sizeOf(context).width - position.dx - iconSize / 2 : null, + left: isOnTheRightEdge ? null : position.dx - iconSize / 2, top: position.dy - differenceInHeight - iconSize / 2, child: Tooltip( message: 'Drag to reposition',