Commit graph

213 commits

Author SHA1 Message Date
Marc Durdin
f56beba185 fix(mac): kmp.inf is windows-1252
Relates to #5316.

Keyman for mac is still reading from kmp.inf, but was treating it as
UTF-8. However, it is windows-1252 encoding. This was stopping Keyman
from loading the file due to the presence of a (C) symbol.

Keyman for mac *should* be loading kmp.json. This needs to be addressed
as a separate issues.
2021-06-22 07:08:08 +10:00
Marc Durdin
5fac633fb6 fix(common): build script help param
When working on a new build script, I tripped over the `-?` question
mark help parameter here, as it needs to be escaped. Opted to fix all
the instances in our scripts, although AFAICT there would not have been
current bugs arising from this, as there were no conflicting one
character options lower in the case list.
2021-05-28 09:50:40 +10:00
Marc Durdin
647c20ebc7 chore: support for xcode 12
Fixes #4994.
2021-04-29 14:30:10 +10:00
Marc Durdin
eeb8153252 fix(mac): prevent duplicate keyboards in list
Fixes #4058.
Fixes #4528.

Prevents duplicate keyboards from appearing in the list. If there are
already duplicates in the list, they will be cleaned up the next time a
keyboard is added or removed in Configuration.
2021-03-15 20:14:56 +11:00
Marc Durdin
2e4d19be99
Merge pull request #4673 from keymanapp/fix/mac/3979-local-help
fix(mac): show local help in app
2021-03-15 20:12:42 +11:00
Marc Durdin
637cc064da fix(mac): show local help in app
Fixes #3979.

Instead of loading help.keyman.com in the support frame, we now load a
local copy of the help. External links within the help will open in the
user's browser. This avoids issues of navigation to keyboard download
and other sites which won't work well.

Also, adds Back, Forward and Home buttons to the window so the user can
navigate more easily with mouse.

Finally, this means that the local help will always be synchronised with
the app version and brings the macOS help in line with the other
platforms.
2021-03-15 17:21:19 +11:00
Marc Durdin
3ba46ad07a chore(mac): missed about window 2021-03-15 16:26:34 +11:00
Marc Durdin
0f655f99b3 chore(mac): tweak close notification 2021-03-15 16:24:53 +11:00
Marc Durdin
f8e40182fe fix(mac): release window resources on close
Fixes #3972.

Ensure that window controllers are released when we close the window, so
that we are starting again when we want to use the window again in the
future.

There are a number of ugly patterns in this code, but fixing those is
outside scope for the beta.
2021-03-15 16:05:26 +11:00
Marc Durdin
0c01f7c41d fix(mac): register configuration window on load
Fixes #3945.

When the configuration window is opened via `showPreferences`, we were
not aware that the configuration window had been opened, so subsequent
references to it would recreate it.
2021-03-15 14:59:30 +11:00
Marc Durdin
be544f49a7 fix(mac): Handle duplicate filenames for packages
If multiple copies of a package are saved by a browser, the browser will
typically append a ` (#)` to the filename, where `#` is a number. This
should be stripped off before installation to prevent duplicates of the
package being installed.

Fixes #2488.
2020-11-26 14:44:38 +11:00
Marc Durdin
01b192796a feat(mac): user-controllable legacy app list
Fixes #1953.

Makes it possible to specify additional apps that need 'legacy' handling
without requiring an updated build of Keyman for Mac. The list should be
stored in user defaults under the `KMLegacyApps` key. It can be viewed
with the command:

```
defaults read keyman.inputmethod.Keyman KMLegacyApps
```

And updated with

```
defaults write keyman.inputmethod.Keyman KMLegacyApps -array value1 value2 ...
defaults write keyman.inputmethod.Keyman KMLegacyApps -array-add value1 value2 ...
```

Each entry should be a regex that matches the client app id.

For example:

```
defaults write keyman.inputmethod.Keyman KMLegacyApps -array com.microsoft.Word '^com.github.atom$'
```

(Note for purity, the `.` should be escaped in the regex but it'll
actually be fine without...)

This commit also adds the `keymanDataPath` method on
`KMInputMethodAppDelegate`, so we can place additional configuration
data there in the future (as opposed to in the shared config which is
less easy for users to edit.)
2020-11-25 16:56:52 +11:00
Marc Durdin
daff70bebf fix(mac): arrow keys now reset context
Fixes #3939.

Arrow keys, function keys and a handful of other keys should trigger a
context reload (for legacy apps, that means a context flush). This means
that deadkeys are also flushed when any of these keys are pressed, in
the same way as a Command key or a mouse click already did.
2020-11-25 13:15:12 +11:00
Marc Durdin
6a4038497b
Merge pull request #3944 from keymanapp/fix/mac/3935-legacy-mode-for-java
fix(mac): turn on legacy mode for Java apps
2020-11-25 12:50:03 +11:00
Marc Durdin
044631cd54 fix(mac): turn on legacy mode for Java apps
Relates to #3935.

This switches Java apps into legacy mode. However, Java itself will need
patching to support Keyman, as it makes assumptions about input methods,
including matching specific input methods by name, before enabling its
complex text support.

I am in process of submitting a bug report and may try and submit a
patch (although the process seems a little convoluted). It requires a
change to a single file, AWTView.m, with the following diff (against
JDK 16.0):

diff --git a/src/java.desktop/macosx/native/libawt_lwawt/awt/AWTView.m b/src/java.desktop/macosx/native/libawt_lwawt/awt/AWTView.m
index 3e80b5a6cf3..2ae1f4f3f12 100644
--- a/src/java.desktop/macosx/native/libawt_lwawt/awt/AWTView.m
+++ b/src/java.desktop/macosx/native/libawt_lwawt/awt/AWTView.m
@@ -263,6 +263,16 @@ - (void) keyDown: (NSEvent *)event {
     fProcessingKeystroke = YES;
     fKeyEventsNeeded = YES;

+    if([(NSString *)kbdLayout containsString:@"keyman"]) {
+        // Keyman handles all key events; none should be
+        // passed through as default before Keyman processes them
+        fKeyEventsNeeded = NO;
+    }
     // Allow TSM to look at the event and potentially send back NSTextInputClient messages.
     [self interpretKeyEvents:[NSArray arrayWithObject:event]];

@@ -960,7 +989,9 @@ - (void) insertText:(id)aString replacementRange:(NSRange)replacementRange

     if ((utf16Length > 2) ||
         ((utf8Length > 1) && [self isCodePointInUnicodeBlockNeedingIMEvent:codePoint]) ||
-        ((codePoint == 0x5c) && ([(NSString *)kbdLayout containsString:@"Kotoeri"]))) {
+        ((codePoint == 0x5c) && ([(NSString *)kbdLayout containsString:@"Kotoeri"])) ||
+        ([(NSString *)kbdLayout containsString:@"keyman"])
+        ) {
         aStringIsComplex = YES;
     }
2020-11-25 09:59:10 +11:00
Marc Durdin
258fed6511 fix: wrong variable type 2020-11-24 08:04:30 +11:00
Marc Durdin
e41df6f838 fix(mac): re-sign files post plist update
Cleans up a bunch of bits and pieces around the build process and makes
sure that files are re-signed after we update the Info.plist file.
2020-11-24 08:02:16 +11:00
Marc Durdin
e1627260f3 chore(mac): use new keyboard install page
Fixes #3898.

This reworks the keyboard download window to use the new keyboard
install page and url pattern. Some refactoring of the downloadKeyboard
method was required to handle the new download patterns.
2020-11-20 13:39:12 +11:00
Marc Durdin
c2401514cb fix(mac): support page and copyright
Fixes #3849.

* Uses keyman-staging.com when on alpha or beta
* Updates copyright year at build time
* Fixes link to help documentation (/mac, not /macosx)
2020-11-20 05:55:53 +11:00
Marc Durdin
da8dbc59fb fix(mac): codesign resilience
This PR tries to make codesign more resilient to failure, by retrying
a build step that falls over with code 65. This code is not limited to
codesign but most frequently happens with it.

A more complete answer would be to do the codesigning step in build.sh
instead of in the project, which would give us more control of the
outcome, and maybe simplify the build process somewhat, but I will
leave that for now, because it is usually better to leave that to XCode.
2020-11-19 10:24:36 +11:00
Marc Durdin
66601f5f91 fix(mac): add icon for Keyman.app
Fixes #2717.
2020-11-19 10:08:35 +11:00
Marc Durdin
c8070718d9 chore: fixup plists 2020-11-19 09:07:54 +11:00
Marc Durdin
d98f042e4b chore: fix podfile for tests 2020-11-19 08:51:33 +11:00
Marc Durdin
c20cd9e20f chore: add library to tests 2020-11-19 06:03:19 +11:00
Marc Durdin
ea86ce0fbe chore: typo 2020-11-18 20:18:43 +11:00
Marc Durdin
bede3948d2 feat(mac): Sentry support
I wasn't going to do this, but realised that crash reporting was going
to be a problem on mac because it still used crashlytics/fabric. Turned
out to be a good exercise to get me back into macOS world, and fairly
straightforward to get right (helps that the other platforms broke the
ice for me).
2020-11-18 17:13:20 +11:00
Marc Durdin
255e4f4b7a chore: Merge branch 'master' into chore/beta-to-master-p9s2-1 2020-02-17 10:11:15 +11:00
Marc Durdin
06063199c0 fix(mac): attempt multiple times to detach dmg in build 2020-02-14 11:50:35 +11:00
Marc Durdin
4281b72b26 chore(mac): Merge branch 'beta' into fix/mac/install-fails-with-quarantine 2020-02-14 11:26:43 +11:00
Marc Durdin
4899ae5841 refactor(mac): initial steps of input pathway
The handleEvent function has somewhat convoluted logic around emitting
the final transform to the client application. This starts to refactor
that code to move all client interaction to a single point at the end
of the event sequence.

Next phase will be to update delete and insert events to turn them into
a single action where possible.
2020-02-12 19:56:53 +11:00
Marc Durdin
8784e142c3 chore(mac): address review comments 2020-02-07 16:14:10 +11:00
Marc Durdin
f856785742 fix(mac): Modifier keys were resetting cached context
Fixes #2375.

For applications that do not provide context to Keyman, Keyman was losing
the context buffer whenever a modifier key was pressed or released. This
change modifies the cache reset to occur only when the Command modifier is
pressed.
2020-02-05 19:32:03 +11:00
Marc Durdin
9a637a6230 fix(mac): Additional tidy up of dmg 2020-02-05 18:23:10 +11:00
Marc Durdin
d6dbe602c2 fix(mac): dmg background and script tweaks 2020-02-05 16:31:27 +11:00
Marc Durdin
e7ae5bdf08 feat(mac): tweaks to dmg and script 2020-02-05 16:12:52 +11:00
Marc Durdin
b207185356 fix(mac): remove version param 2020-01-30 06:14:55 +11:00
Marc Durdin
ccfef64c99 chore(mac): use new version infrastructure 2020-01-29 11:15:36 +11:00
Marc Durdin
f8ea457325 feat(mac): install script
First steps towards a clean install script
for Keyman for Mac. Some steps still out-
of-order for now, particularly opening
System Preferences to allow Keyman before
Keyman has run for first time.
2020-01-29 10:12:26 +11:00
Marc Durdin
b7f9a83c63 chore: version numbers 2020-01-28 14:30:04 +11:00
Marc Durdin
071dd868f2 fix(mac): remove execute perm on symlinks 2020-01-27 08:41:37 +11:00
Marc Durdin
2dfade5bf4 fix(mac): more research 2020-01-27 08:26:35 +11:00
Marc Durdin
598de34615 fix(mac): install fails with quarantine
This is a trial change to the installer to replace
an alias with a symlink. There are a number of
potential issues here so this is just an experiment.
2020-01-27 07:32:37 +11:00
Marc Durdin
1a893fc352 feat(mac): add QR Code to share keyboard
Part of #1535. Mirrors work in Windows.
2019-12-06 22:05:17 +01:00
Marc Durdin
db5c4e6a26 fix(mac): osk shows unexpectedly
Fixes #2346. The OSK would show unexpectedly when switching
applications because the last active window was inconsistently
cleared.
2019-12-04 11:11:04 +01:00
Marc Durdin
d9e8e546dc chore(mac): update build notes 2019-12-04 10:21:55 +01:00
Marc Durdin
0a2d8f055a
Merge branch 'master' into beta-alpha-p7s5 2019-08-22 14:40:03 +09:30
Marc Durdin
5d5db2757d [mac] Fix typos 2019-08-08 19:47:35 +10:00
Marc Durdin
256ba2ef1e [mac] Support Adobe products in legacy mode (and VS Code) 2019-08-08 19:36:27 +10:00
Marc Durdin
8fd9bc7e74 [mac] Fix tests; add global workspace 2019-08-08 10:46:20 +10:00
Marc Durdin
d035344d2d [mac] Update version numbers for 13.0 alpha 2019-08-05 08:32:10 +10:00