Skip to content

Instantly share code, notes, and snippets.

View ShikiSuen's full-sized avatar
🍍

ShikiSuen ShikiSuen

🍍
View GitHub Profile
@ShikiSuen
ShikiSuen / MSIME-CHSOutput-Issue.md
Last active April 16, 2024 01:53
Microsoft New Phonetic IME cannot type ㄌㄩㄝ and ㄋㄩㄝ if Simplified Chinese output is enabled.

Issue

Microsoft New Phonetic IME cannot type ㄌㄩㄝ and ㄋㄩㄝ if Simplified Chinese output is enabled.

Screen Recordings

See comment thread.

Affected IMEs

這裡澄清一下:這不是巨集,不是外掛腳本,而是可以在另一台設備上跑的計算程式。

image image

// (c) 2024 Shiki Suen. (MIT-License).
// 用於《崩壞:星穹鐵道》2.1 版的調酒活動。
struct 特調 {
let 名稱: String
let 甜度: Int // 甜度
let 柔和度: Int // 柔和度
let 清爽度: Int // 清爽度
// (c) 2024 Shiki Suen. (MIT-License).
// 用於《崩壞:星穹鐵道》2.1 版的調酒活動。
struct Nomimono {
let name: String
let amami: Int // 甜度
let yawarakasa: Int // 柔和度
let sawayakasa: Int // 清爽度
@ShikiSuen
ShikiSuen / IMKSuggestion.md
Last active March 24, 2024 07:29
Let's talk about what InputMethodKits needs to improve.

Related sample project: https://github.com/vChewing/vChewing-macOS/tree/3.4.9

It seems that individual bug reports doesn't work at all. Besides, the entire InputMethodKit needs a renovation.

This thread will be sent to Apple by certain special approaches after gathering enough usable information.

Let's talk about what InputMethodKits needs to improve. Here's my conclusion. If Apple think there's already an API, then it might be either mulfunctioning or not exposed to Swift.

  1. An official Swift-friendly wrapper with neither "!" nor "?" in the parameters of all provided APIs.
@ShikiSuen
ShikiSuen / UIDevice-identifierForVendor-macOS.swift
Created December 8, 2023 12:31
"identifierForVendor" for macOS
// (c) 2023 and onwards The vChewing Project (MIT-NTL License).
// ====================
// This code is released under the MIT license (SPDX-License-Identifier: MIT)
// ... with NTL restriction stating that:
// No trademark license is granted to use the trade names, trademarks, service
// marks, or product names of Contributor, except as required to fulfill notice
// requirements defined in MIT License.
/// A Swift script to check whether a non-system process is abusing the SecureEventInput.
import IOKit
@ShikiSuen
ShikiSuen / String-getRenderedDimension.swift
Created March 9, 2024 14:46
NSString.getRenderedDimension().
// (c) 2022 and onwards The vChewing Project (MIT-NTL License).
// ====================
// This code is released under the MIT license (SPDX-License-Identifier: MIT)
// ... with NTL restriction stating that:
// No trademark license is granted to use the trade names, trademarks, service
// marks, or product names of Contributor, except as required to fulfill notice
// requirements defined in MIT License.
import CoreText
import Foundation
@ShikiSuen
ShikiSuen / SecureEventInputAbuseChecker.swift
Last active March 7, 2024 17:53
A Swift script to check whether there's any process abusing the SecureEventInput in the background.
// (c) 2023 and onwards The vChewing Project (MIT-NTL License).
// ====================
// This code is released under the MIT license (SPDX-License-Identifier: MIT)
// ... with NTL restriction stating that:
// No trademark license is granted to use the trade names, trademarks, service
// marks, or product names of Contributor, except as required to fulfill notice
// requirements defined in MIT License.
/// A Swift script to check whether a non-system process is abusing the SecureEventInput.
@ShikiSuen
ShikiSuen / ApplyTransformFW2HW.swift
Created March 5, 2024 15:29
ApplyTransformFW2HW
// (c) 2021 and onwards The vChewing Project (MIT-NTL License).
// ====================
// This code is released under the MIT license (SPDX-License-Identifier: MIT)
// ... with NTL restriction stating that:
// No trademark license is granted to use the trade names, trademarks, service
// marks, or product names of Contributor, except as required to fulfill notice
// requirements defined in MIT License.
extension String {
// This only works with ASCII chars.
@ShikiSuen
ShikiSuen / IndexRevolver.swift
Last active October 23, 2023 20:22
Swift Index Revolver (requiring Swift 5.6)
// (c) 2021 and onwards Shiki Suen (MIT-NTL License).
// ====================
// This code is released under the MIT license (SPDX-License-Identifier: MIT)
import Foundation
extension Collection {
public func revolvedIndex(_ id: Int, clockwise: Bool = true, steps: Int = 1) -> Int {
if id < 0 || steps < 1 { return id }
var result = id