MIT License

项目介绍

Clipy/Sauce 是一个托管在 GitHub 上的开源项目,主要使用 Swift 编写,采用 MIT License 许可证,目前获得 94 个 Star、23 次 Fork。

仓库全名
Clipy/Sauce
开源许可证
MIT License
Star 数
94
Fork 数
23
未关闭 Issue
1

README 摘要

Sauce Mapping various keyboard layout sources and key codes in macOS. (e.g.: QWERTY, Dvorak) Motivation Only the ANSI-standard US keyboard is defined for the key code defined in Carbon.framework. Therefore, we can obtain only the key code of the QWERTY keyboard layout. (e.g.: kVKANSIV) In layout other than QWERTY, (e.g. Dvorak) the virtual key code is different. Keyboard Layout | Key | Key Code | :---------------: |…

完整内容见 GitHub 原始 README 或本页 。

常见问题

Sauce 用什么语言开发?

主要使用 Swift 编写,采用 MIT License 许可证,目前有 94 个 Star。

Sauce 可以免费商用吗?

仓库采用 MIT License 许可证,可免费使用与修改,商业使用请遵守许可证条款(例如保留版权声明与许可声明)。

如何获取 Sauce 的源码?

可以直接克隆仓库:git clone https://github.com/Clipy/Sauce.git,默认分支为 master;安装与运行步骤见仓库 README。

Sauce 最近还在维护吗?

仓库最近一次更新为 8月18日,当前有 1 个未关闭 Issue;Star 数为 94,可作为社区活跃度的参考。

关于

GitHub 原始描述(英文)

Mapping various keyboard layout sources and key codes in macOS. (e.g.: QWERTY, Dvorak)

描述取自 GitHub 官方 API,保持仓库作者书写的原文。

简要分析

热度分
144
价值分
63
活跃状态
活跃

语言占比

Ruby
Swift

Release

README

Sauce

CI Release version License: MIT

Mapping various keyboard layout sources and key codes in macOS. (e.g.: QWERTY, Dvorak)

Motivation

Only the ANSI-standard US keyboard is defined for the key code defined in Carbon.framework. Therefore, we can obtain only the key code of the QWERTY keyboard layout. (e.g.: kVK_ANSI_V)
In layout other than QWERTY, (e.g. Dvorak) the virtual key code is different.

Keyboard Layout Key Key Code
QWERTY v 9
Dvorak v 47

This library is created with the purpose of mapping the key code of the input sources and making it possible to obtain the correct key code in various keyboard layouts.

Example

Key codes

Get the key code of the current input source.

let keyCode = Sauce.shared.keyCode(for: .v)

Key

Get the Key of the current input source.

let key = Sauce.shared.key(for: keyCode)

Character

Get the character of the current input source.

let character = Sauce.shared.character(for: keyCode, modifiers: .carbon(shiftKey))
let character = Sauce.shared.character(for: keyCode, modifiers: .cocoa([.shift]))

Notification

NSNotification.Name.SauceEnabledKeyboardInputSourcesChanged

SauceEnabledKeyboardInputSourcesChanged is the same as kTISNotifyEnabledKeyboardInputSourcesChanged in Carbon.framework

NSNotification.Name.SauceSelectedKeyboardInputSourceChanged

SauceSelectedKeyboardInputSourceChanged is different from kTISNotifySelectedKeyboardInputSourceChanged and is notified only when the input source id has changed.
Since it is filtered and notified, please do not use it for the same purpose as normal kTISNotifySelectedKeyboardInputSourceChanged.

NSNotification.Name.SauceSelectedKeyboardKeyCodesChanged

By using this Notification, can detect when the setting changes with the same keyboard layout, when the input source changes from QWERTY to Dvorak, and so on.

评论

暂无评论