InputMethodKit

RSS for tag

Develop input methods and manage communication with client applications, candidates windows, and input method modes using InputMethodKit.

Posts under InputMethodKit tag

7 Posts
Sort by:

Post

Replies

Boosts

Views

Activity

A phone keyboard layout for easy typing!
Last November 13 I came up with a phone keyboard layout (strategy) that can make key size bigger hence less mistyping. The typical phone keyboard looks like this: My proposed keyboard looks like this: Essentially, it's a split keyboard with the left-hand part stacked above/below the right-hand part. Key size/width/height and the vertical distance between the left-hand part and right-hand part may be adjustable to suit different phone widths and user hand sizes. You guys can show the proposed keyboard's image on your phone and fit this keyboard to your phone width so you can actually simulate typing on it to see how it feels. On my phone, the letter keys in it are a little too big for my thumbs to reach the farthest keys, but as I said, key size should be adjustable to suit different phone widths and user hand sizes.
0
0
310
Oct ’24
There is a problem when switching keyboards on iPhone, constantly prompting how to switch keyboards
When switching keyboards on an iPhone, an operation prompt will appear every time it switches. When this issue occurs, change the phone's system keyboard, add or delete it, and the keyboard in the app will not decrease or decrease accordingly. It seems that it has disconnected from the system keyboard. I don't know what situation may cause this problem. I request help
0
0
146
Sep ’24
Receiving Error Messaging Opening VLC
I've uninstalled and reinstalled VLC media player multiple times. However, I receive the following message opening the app after each installation: Translated Report (Full Report Below) Process: VLC [71778] Path: /Applications/VLC2.app/Contents/MacOS/VLC Identifier: org.videolan.vlc Version: 3.0.21 (3.0.21) Code Type: ARM-64 (Native) Parent Process: launchd [1] User ID: 501 Date/Time: 2024-08-14 12:27:24.3563 -0400 OS Version: macOS 14.6.1 (23G93) Report Version: 12 Anonymous UUID: 9DDE1CE7-A635-1165-0FE9-04EA599A542F Sleep/Wake UUID: E22A843E-7A51-414F-BA7F-AB35B1674915 Time Awake Since Boot: 300000 seconds Time Since Wake: 267959 seconds System Integrity Protection: enabled Crashed Thread: 0 Dispatch queue: com.apple.main-thread Exception Type: EXC_BAD_ACCESS (SIGSEGV) Exception Codes: KERN_INVALID_ADDRESS at 0x0000000102af4ae8 Exception Codes: 0x0000000000000001, 0x0000000102af4ae8 Termination Reason: Namespace SIGNAL, Code 11 Segmentation fault: 11 Terminating Process: exc handler [71778] VM Region Info: 0x102af4ae8 is not in any region. Bytes after previous region: 2793 Bytes before following region: 783640 REGION TYPE START - END [ VSIZE] PRT/MAX SHRMOD REGION DETAIL __LINKEDIT 102ae8000-102af4000 [ 48K] r--/rwx SM=COW /Applications/VLC2.app/Contents/Frameworks/Breakpad.framework/Versions/A/Resources/breakpadUtilities.dylib ---> GAP OF 0xc0000 BYTES __TEXT 102bb4000-102c78000 [ 784K] r-x/rwx SM=COW /Applications/VLC2.app/Contents/MacOS/lib/libvlccore.9.dylib Application Specific Information: *** multi-threaded process forked *** crashed on child side of fork pre-exec Thread 0 Crashed:: Dispatch queue: com.apple.main-thread 0 libsystem_trace.dylib 0x193d8b0c0 _os_log_preferences_refresh + 68 1 libsystem_trace.dylib 0x193d8bb20 os_log_type_enabled + 712 2 CoreFoundation 0x1940da800 _CFBundleCopyPreferredLanguagesInList + 516 3 CoreFoundation 0x1940e75a4 _CFBundleCopyLanguageSearchListInBundle + 124 4 CoreFoundation 0x1940e738c _copyQueryTable + 64 5 CoreFoundation 0x1940e6d5c _copyResourceURLsFromBundle + 376 6 CoreFoundation 0x1940e6118 _CFBundleCopyFindResources + 1400 7 CoreFoundation 0x1940e5b90 CFBundleCopyResourceURL + 56 8 CoreAudio 0x1966c3b58 HALSystem::InitializeShell() + 1412 9 CoreAudio 0x1966c3274 HALSystem::CheckOutInstance() + 192 10 CoreAudio 0x19693360c AudioObjectSetPropertyData_mac_imp + 116 11 libauhal_plugin.dylib 0x10290915c 0x102904000 + 20828 12 VLC 0x1025df4dc 0x1025d8000 + 29916 13 dyld 0x193cb3154 start + 2476 Thread 0 crashed with ARM Thread State (64-bit): x0: 0x00000001fbe8cfec x1: 0x0000000193da0985 x2: 0x0000000001000104 x3: 0x0000000000000000 x4: 0x0000000193da0937 x5: 0x000000016d826500 x6: 0x0000000000000074 x7: 0x0000000000000000 x8: 0x0000000102af4ae6 x9: 0x00000001fbe97610 x10: 0x0000000000000001 x11: 0x0000000143909730 x12: 0x0000000000000001 x13: 0x000000016d8266f0 x14: 0xaaaaaaaaaaaaaaaa x15: 0x0000000193da01db x16: 0x0000000193ffd7d4 x17: 0x000000020658e3e0 x18: 0x0000000000000000 x19: 0x0000000143909700 x20: 0x0000000143909700 x21: 0x0000000102af4aea x22: 0x0000000102af4aea x23: 0x0000000143d069f0 x24: 0x0000000143d075a0 x25: 0x0000000000000016 x26: 0x0000000000000000 x27: 0x0000000143d07c60 x28: 0x0000000143d06af0 fp: 0x000000016d826a30 lr: 0x0000000193d8b0a4 sp: 0x000000016d8269e0 pc: 0x0000000193d8b0c0 cpsr: 0x20001000 far: 0x0000000102af4ae8 esr: 0x92000007 (Data Abort) byte read Translation fault
1
0
459
Aug ’24
Chinese Input Method Get Stuck on macOS 14.5 to 15 beta 3
As the title suggests, Chinese Input Method Get Stuck on macOS 14.5 to 15 beta 3. And this issue has a reproducible path. When using the Chinese input method, if you enter "zxcvb" or "mnbvc" in sequence in any text feild, you will have problems entering any further characters, util press "esc" button or change another input method. If this problem occurs multiple times in a short period of time, the mouse click event will also be blocked for a few seconds. Hope this issue be fixed soon.
0
0
330
Jul ’24
Mysterious error when using a WKWebView in an InputMethodKit app
I modified an InputMethodKit example (fairly recent one from github, compiled fine and worked as expected on my machine as it was) to create a window with a WKWebView and the window doesn't load. I know that loadView is getting called, but the window never appears after calling showWindow on the window controller and there is a mysterious error in the console: bootstrap_check_in(): (os/kern) unknown error code (44c) From googling this it seems App Sandbox related, but I think I have everything set up correctly (App Sandbox on with outgoing connections allowed) Totally stumped, any help or ideas would be appreciated Here's the relevant code: View controller import Foundation import WebKit import AppKit class InputWindowViewController: NSViewController, WKUIDelegate { var webView: WKWebView! override func loadView() { NSLog("LoadView") webView = WKWebView() self.view = webView webView.uiDelegate = self webView.needsDisplay = true } override func viewDidLoad() { super.viewDidLoad() webView.load(URLRequest(url: URL(string:"https://www.apple.com")!)) } } Window controller import AppKit import Foundation import WebKit class InputWindowController: NSWindowController { var controller: InputWindowViewController? override init(window: NSWindow?) { controller = nil super.init(window: window) } override func loadWindow() { self.window = NSWindow(contentViewController: controller!) } required init?(coder: NSCoder) { controller = nil super.init(coder: coder) } } AppDelegate import Cocoa import InputMethodKit import WebKit // Necessary to launch this app class NSManualApplication: NSApplication { private let appDelegate = AppDelegate() override init() { super.init() self.delegate = appDelegate } required init?(coder: NSCoder) { // No need for implementation fatalError("init(coder:) has not been implemented") } } @main class AppDelegate: NSResponder, NSApplicationDelegate { var server = IMKServer() var candidates = IMKCandidates() var inputWindowController = InputWindowController() func applicationDidFinishLaunching(_ notification: Notification) { // Insert code here to initialize your application server = IMKServer(name: Bundle.main.infoDictionary?["InputMethodConnectionName"] as? String, bundleIdentifier: Bundle.main.bundleIdentifier) inputWindowController = InputWindowController() inputWindowController.controller = InputWindowViewController() inputWindowController.loadWindow() inputWindowController.showWindow(self) candidates = IMKCandidates(server: server, panelType: kIMKSingleRowSteppingCandidatePanel, styleType: kIMKMain) NSLog("tried connection") } func applicationWillTerminate(_ notification: Notification) { // Insert code here to tear down your application } } This code is probably awful in a lot of other ways I don't realize, but I wanted to get a webview window up before I put a bunch of time into this thing XCode 13.4 MacoOS 12.7.4
1
0
600
Apr ’24
A Swift input method switcher works only after changing focus to another window
-1 I am trying to write a MacOS app which switch input methods by previously assigned shortcut(command+space in here). Switching input methods preoperly works so that the language icon at the status bar(top right) immediately changes as I put the shortcut. The problem I got in here is that the actual input method does not change. For example, if I run my app when the selected input method is Korean, then although the status bar is showing the selected input method is Japanese after command+space, what I can only type is Korean characters. However, after I change focus to another text app(e.g. from sublime text to xcode), only then the selected input method is reflected well. I am using MacOS Monterey 12.6 and Xcode 13.1. My project contains two source files. The code in the file AppDelegate.swift is as follows: import Cocoa @NSApplicationMain class AppDelegate: NSObject, NSApplicationDelegate { var switcher = Switcher() } And the code in the file Switcher.swift is as follows: import Cocoa import MASShortcut class Switcher{ var lang: Int = 0 var kr: TISInputSource? var jp: TISInputSource? var en: TISInputSource? init(){ let inputSourceNSArray = TISCreateInputSourceList(nil, false).takeRetainedValue() as NSArray let inputSourceList = inputSourceNSArray as! [TISInputSource] for inputSource in inputSourceList { if inputSource.id == "com.apple.inputmethod.Korean.2SetKorean" { self.kr = inputSource } if inputSource.id == "com.apple.inputmethod.Kotoeri.RomajiTyping.Japanese" { self.jp = inputSource } if inputSource.id == "com.apple.keylayout.ABC" { self.en = inputSource } } self.register() } func switchLang(){ self.lang = (self.lang + 1) % 3 switch lang { case 0: TISSelectInputSource(self.kr) case 1: TISSelectInputSource(self.jp) case 2: TISSelectInputSource(self.en) default: print("error") } } func register() { let langShortcut = MASShortcut(keyCode: kVK_Space, modifierFlags: [.command]) MASShortcutMonitor.shared()?.register(langShortcut, withAction: { self.switchLang() }) } } I wrote these codes by referring KAWA, but KAWA does not make this issue. I have analyzed all codes of KAWA several times, I couldn't find out why the same problem does not occur in KAWA. I am quite new to Swift, and I have no idea to approach. Could you help me....? Thank you.
0
0
561
Mar ’24