Git Product home page Git Product logo

mediakeytap's People

Contributors

danbee avatar maxmamis avatar nhurden 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

mediakeytap's Issues

Calling TIS/TSM in non-main thread environment

Trying to use this library in my current Xcode project and I'm seeing this warning appear in the console when a media key is pressed. It does seem to be working just fine apart from that, but the warning is concerning.

pid(87021)/euid(501) is calling TIS/TSM in non-main thread environment,
ERROR : This is NOT allowed. Please call TIS/TSM in main thread!!!

macOS Sonoma

Hi,
As I know this framework not work in macOS Sonoma any update soon?

Fix F14/F15 keys for native Apple Keyboards (They should not change brightness)

See : MonitorControl/MonitorControl#100 (comment)
F14 and F15 should not be intercepted for these keyboards as Brightness keys.

For these Apple keyboards with F13-F19 keys available (eg. 'Magic Keyboard with Numeric Keypad'), the native brightness controls (media keys) are on the F1+F2 key positions, not the intercepted :

Key Down
	Characters:	
	Unicode:		63249 / 0xf711
	Keys:		F14
	Key Code:	107 / 0x6b
	Modifiers:	8388864 / 0x800100 ⓘ

Key Down
	Characters:	
	Unicode:		63250 / 0xf712
	Keys:		F15
	Key Code:	113 / 0x71
	Modifiers:	8388864 / 0x800100 ⓘ

Unable to run this: Converting non-escaping value to 'T' may allow it to escape

Error at following line in MediaKeyTapInternals.swift:
let refcon = unsafeBitCast(callback, to: UnsafeMutableRawPointer.self)

private func keyCaptureEventTapPort(callback: EventTapCallback) -> CFMachPort? {
        let cCallback: CGEventTapCallBack = { proxy, type, event, refcon in
            let innerBlock = unsafeBitCast(refcon, to: EventTapCallback.self)
            return innerBlock(type, event).map(Unmanaged.passUnretained)
        }

        let refcon = unsafeBitCast(callback, to: UnsafeMutableRawPointer.self)

        return CGEvent.tapCreate(
            tap: .cgSessionEventTap,
            place: .headInsertEventTap,
            options: .defaultTap,
            eventsOfInterest: CGEventMask(1 << NX_SYSDEFINED),
            callback: cCallback,
            userInfo: refcon)
    }

Disable Media keys

Hi, I am using AVPlayerView in my app, I am able to start video with media key, is there any way to disable it? I really need it. I want to disable media keys in my macOS app.

Customize isMediaKeyEvent?

Hi,

How can I customize the hardcoded isMediaKeyEvent function in MediaKeyTap/NSEventExtensions.swift? I want to add NX_KEYTYPE_SOUND_UP and NX_KEYTYPE_SOUND_DOWN constants. Is there a way to customize this? Thanks!

Adding Support for headphone media keys?

I've noticed that MediaKeyTap seems to respond only to actual keyboard media keys, and not the buttons on headsets plugged into the audio port, or bluetooth headsets.

I've used BeardedSpice, and noticed that it supports these buttons, so I looked under the hood. It seems, while it uses SPMediaKeyTap, it also uses DDHidLib to somehow capture these additional "AppleMikey" button presses.

Is that something you'd consider adding as additional triggers for play/pause, forward/next, back/previous?

Xcode 10 support

Compiling the project on Xcode 10 gives the error Converting non-escaping value to 'T' may allow it to escape at this line:
let refcon = unsafeBitCast(callback, to: UnsafeMutableRawPointer.self)
in the function: keyCaptureEventTapPort in the file: MediaKeyTapInternals.swift

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.