Coder Social home page Coder Social logo

Comments (3)

DivineDominion avatar DivineDominion commented on July 30, 2024

Turns out that makeFirstResponder is not the problem. In the example app, you can reproduce this e.g. by holding shift ⇧ and type a letter, continue holding shift, and type another letter. The second letter will not be accepted.

The problem is that flagsChanged(_:) will not be called when the user releases the modifier key, only when pressing it. So we have to reset inputModifiers somewhere.

But resetting it with inputModifiers = NSEvent.ModifierFlags(rawValue: 0) in endRecording is not a good place. I'll experiment with calling flagsChanged from keyUp instead, and resetting when key view status is lost.

from keyholder.

DivineDominion avatar DivineDominion commented on July 30, 2024

Weirdly, hitting space is configured to always begin recording in performKeyEquivalent(with:). Why is that so?

        // ...
        } else if Int(theEvent.keyCode) == kVK_Space {
            return beginRecording()
        }
        // ...

This allows one to reenable recording:

  1. hold shift (and never release)
  2. hit a key, e.g. "F" to change the shortcut
  3. hit another key, e.g. "D" and notice the beep
  4. hit space
  5. hit another key again to change the shortcut

I think this is not intentional?

from keyholder.

Econa77 avatar Econa77 commented on July 30, 2024

Closed by #11 #47

from keyholder.

Related Issues (17)

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.