Code Monkey home page Code Monkey logo

sauce's People

Contributors

akring avatar dependabot[bot] avatar divinedominion avatar econa77 avatar jasonm23 avatar zshannon avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

sauce's Issues

Incorrect characters for number keys on Czech layout

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 โ‡ง.
Screenshot 2023-01-31 at 09 26 23

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.

KeyboardLayout notification not working reliable

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?

rename parameter "by" in e.g. keyCode(by:) and character(by:) to "for"

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 :)

support conversion from NSMenuItem.keyEquivalent to Sauce.Key

Currently, neither Key.init(rawValue:) nor Key.init(character:virtualKeyCode:) produce .return when passing in "\r". That's what you get when you bind a NSMenuItem to the return key:

image

Maybe an extension on NSMenuItem that exposes key would be useful.

`fn` key missing?

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?

Unable to monitor 2.3.0

I think there is an issue 2.3.0, it is not monitoring key presses but when I use 2.1.0 it works.

a Godsend

fantastic work and library. any place to donate/sponsor? thanks.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.