[PR #70] [MERGED] Apply various user experience improvements #302

Closed
opened 2026-05-05 05:12:22 -06:00 by gitea-mirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/keycastr/keycastr/pull/70
Author: @sdeken
Created: 9/28/2016
Status: Merged
Merged: 10/2/2016
Merged by: @akitchen

Base: masterHead: master


📝 Commits (1)

  • 4555381 Apply various user experience improvements

📊 Changes

7 files changed (+242 additions, -199 deletions)

View changed files

📝 keycastr/KCAppController.h (+2 -1)
📝 keycastr/KCAppController.m (+143 -46)
📝 keycastr/KCKeyboardTap.h (+9 -3)
📝 keycastr/KCKeyboardTap.m (+88 -67)
keycastr/KCUtility.h (+0 -32)
keycastr/KCUtility.m (+0 -44)
📝 keycastr/KeyCastr.xcodeproj/project.pbxproj (+0 -6)

📄 Description

This does two things to improve usability:

  • Show/hide the dock icon without needing to relaunch the app - right now, we're modifying the installed app's Info.plist file directly to turn LSUIElement on or off. In the bad old days, this was... ok_-ish_... because although it was sort of inconvenient, at least it worked. Somewhere along the line, though, Apple changed the strictness of their requirements for the Accessibility access, and made it so if the app bundle changed, the access was no longer valid. As a result, you couldn't just show or hide the dock icon any more - you have to show or hide the dock icon, relaunch the app, open up the control panel, uncheck the box for KeyCastr, and check the box next to KeyCastr again. Ugh.

This used to be the only way to do it, but now there's a better way - we can just use TransformProcessType to show or hide the icon. There are quirks - the preference window loses focus, for example - but we don't have to change the Info.plist (meaning we don't have to re-authorize the app), and we don't have to relaunch the app. Hooray!

  • Automatically grant Accessibility access when needed - the recent change to launch the settings dialog got me thinking about ways to make the process of granting the Accessibility access even easier. It turns out that, with administrator privileges, we can just write a record directly to the place where the system is looking for it, without asking the user to go in and do it on their own.

I'm not a super big fan of the specific way this works (ugh, AppleScript), and I'm sure it's only a matter of time before Apple changes things again and we have to find another way around, and I wish we could have the system re-evaluate the privileges instead of relaunching the app... but the experience is otherwise pretty slick - just type in the password and it's done. No muss, no fuss.

@akitchen, I'd like your eyes on this one, please!


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/keycastr/keycastr/pull/70 **Author:** [@sdeken](https://github.com/sdeken) **Created:** 9/28/2016 **Status:** ✅ Merged **Merged:** 10/2/2016 **Merged by:** [@akitchen](https://github.com/akitchen) **Base:** `master` ← **Head:** `master` --- ### 📝 Commits (1) - [`4555381`](https://github.com/keycastr/keycastr/commit/455538149fb7f6147251c13af569211ae1600c9e) Apply various user experience improvements ### 📊 Changes **7 files changed** (+242 additions, -199 deletions) <details> <summary>View changed files</summary> 📝 `keycastr/KCAppController.h` (+2 -1) 📝 `keycastr/KCAppController.m` (+143 -46) 📝 `keycastr/KCKeyboardTap.h` (+9 -3) 📝 `keycastr/KCKeyboardTap.m` (+88 -67) ➖ `keycastr/KCUtility.h` (+0 -32) ➖ `keycastr/KCUtility.m` (+0 -44) 📝 `keycastr/KeyCastr.xcodeproj/project.pbxproj` (+0 -6) </details> ### 📄 Description This does two things to improve usability: - **Show/hide the dock icon without needing to relaunch the app** - right now, we're modifying the installed app's Info.plist file directly to turn LSUIElement on or off. In the bad old days, this was... ok_-ish_... because although it was sort of inconvenient, at least it worked. Somewhere along the line, though, Apple changed the strictness of their requirements for the Accessibility access, and made it so if the app bundle changed, the access was no longer valid. As a result, you couldn't just show or hide the dock icon any more - you have to show or hide the dock icon, relaunch the app, open up the control panel, uncheck the box for KeyCastr, and check the box next to KeyCastr again. Ugh. This used to be the only way to do it, but now there's a better way - we can just use TransformProcessType to show or hide the icon. There are quirks - the preference window loses focus, for example - but we don't have to change the Info.plist (meaning we don't have to re-authorize the app), and we don't have to relaunch the app. Hooray! - **Automatically grant Accessibility access when needed** - the recent change to launch the settings dialog got me thinking about ways to make the process of granting the Accessibility access even easier. It turns out that, with administrator privileges, we can just write a record directly to the place where the system is looking for it, without asking the user to go in and do it on their own. I'm not a super big fan of the specific way this works (ugh, AppleScript), and I'm sure it's only a matter of time before Apple changes things again and we have to find another way around, and I wish we could have the system re-evaluate the privileges instead of relaunching the app... but the experience is otherwise pretty slick - just type in the password and it's done. No muss, no fuss. @akitchen, I'd like your eyes on this one, please! --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
gitea-mirror 2026-05-05 05:12:22 -06:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: github-starred/keycastr#302
No description provided.