clipy / sauce Goto Github PK
View Code? Open in Web Editor NEWMapping various keyboard layout sources and key codes in macOS. (e.g.: QWERTY, Dvorak)
License: MIT License
Mapping various keyboard layout sources and key codes in macOS. (e.g.: QWERTY, Dvorak)
License: MIT License
an input of " " won't convert to space? is this intentional?
Thank you for creating this library, it's been essential for my clipboard manager - https://github.com/p0deje/Maccy. I can't even imagine handling all the complexity of converting keycodes to characters and back myself. ๐๐ป
I have been investigating one of the bugs reported by users p0deje/Maccy#482 (comment) and it seems like it could be a problem in the Sauce library itself.
On specific keyboard layouts, for example, Czech, the numbers row is mapped to accented characters and numbers are available by pressing โง.
I am trying to find a proper character to pass to NSMenuItem.keyEquivalent
and I would normally do something like this:
let keyCode = Sauce.shared.keyCode(for: .one)
let char = Sauce.shared.character(for: Int(keyCode), cocoaModifiers: [])
// โฟ Optional<String>
// - some : "1"
However, I would expect "+"
to be returned in this case. I traced the problem to CoreServices.UCKeyTranslate
but I'm not sure how to properly use it to find a necessary character.
I would happily submit PR to fix the problem but need some guidance.
Hi,
When I switch the input source in the menu bar from QWERTY to Dvorak selectedKeyboardInputSourceChanged()
is often not being called. And then it seems to lag behind one change. Thus currentKeyCode(by key: Key) -> CGKeyCode?
return the wrong keyCode. I can not recognise a patterns, seems random to me at the moment.
Can anyone confirm this behaviour?
I'm not a native English speaker myself, but "by" sounds quite odd.
It makes sense when spelled out like this: "Look up a key code by its letter"
Less so when read as as "key code by 'v'" (keyCode(byLetter:)
won't help here, either, though, because the "by" would belong to "look up...by" and the "look up" part is missing)
I'd suggest keyCode(for: .v)
or keyCode(key: .v)
and character(forKeyCode:modifierKeys:)
and similar.
If you want me to open a PR with suggestions, I'll go ahead; didn't want to be that invasive, though :)
can't seem to find it in the code. keyCode value is 179, but Sauce can't find a match and returns nil.
or is it that Sauce handles only Characters? that would make sense, from the loop from 1 to 128?
I think there is an issue 2.3.0, it is not monitoring key presses but when I use 2.1.0 it works.
fantastic work and library. any place to donate/sponsor? thanks.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.