Coder Social home page Coder Social logo

Comments (4)

amrbashir avatar amrbashir commented on May 27, 2024 4

@morajabi thanks for looking into this, the API should be straight forward, you would need to just add a field in GlobalHotKeyEvent

pub enum HotKeyState {
	Pressed,
	Released,
}

pub struct GlobalHotKeyEvent {
    /// Id of the associated [`HotKey`]
    pub id: u32,
	pub state: HotKeyState,
}

from global-hotkey.

morajabi avatar morajabi commented on May 27, 2024 1

I see in the macOS ffi impl we have kEventHotKeyPressed. Is there a reason kEventHotKeyReleased wouldn't work?
(I've seen it used in the wild: https://github.com/cocoabits/MASShortcut/pull/114/files#diff-bd9e25dca147d4385ffb9cc5e3766ae2051e1532203cebc902777a27a880e02fR21)

It is useful for creating a "hold to talk" interaction for our users. Happy to make a PR for macOS if the API is decided upon.

from global-hotkey.

amrbashir avatar amrbashir commented on May 27, 2024

I think this maybe be possible on Linux(X11) and maybe Windows too (I have an idea but haven't tested it yet).

As for macOS, I see in the article that they are using private APIs which will result in your app getting rejected by The App Store so we can't use that. Since I am not a macOS dev, I will have to leave it to someone else to contribute.

from global-hotkey.

Megamannen avatar Megamannen commented on May 27, 2024

+1 on this

from global-hotkey.

Related Issues (20)

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.