Giter VIP home page Giter VIP logo

Comments (3)

muescha avatar muescha commented on June 11, 2024

found a solution with the undocumented hs.hotkey.getLogLevel and hs.hotkey.setLogLevel (#3492)

    local previousLogLevel = hs.hotkey.getLogLevel()
    hs.hotkey.setLogLevel(0)
    hotkeyhandler:disable()
    hs.hotkey.setLogLevel(previousLogLevel)

I created a helper so that i can use it:

hotkeySilence(function()  hotkeyHandler:disable() end)

or just a:

hotkeyDisableSilent(hotkeyHandler)

see my commit where I implemented it:
muescha/dot_hammerspoon@6e8f2d3

from hammerspoon.

muescha avatar muescha commented on June 11, 2024

since I found a workaround we should close the feature request?

or should there be methods with an boolean option? like :disable(silent) and :enable(silent)

from hammerspoon.

Rhys-T avatar Rhys-T commented on June 11, 2024

For what it's worth, entering or exiting an hs.hotkey.modal doesn't print anything unless one of the hotkeys it's enabling/disabling shadows one that was already enabled before you entered the modal (or you setLogLevel to 4 (debug) or higher). That fact isn't exactly documented, but the modal API itself is.

There actually is an isModal parameter to both :enable() and :disable() which is used to implement that, but it's even more private than getLogLevel/setLogLevel (and it's in a different position in each method's signature), so it's probably not a good idea to use that directly:

local function enable(self,force,isModal)
-- force is there just in case it'll be needed down the line; not exposed as public API for now
-- isModal is only used to differentiate loglevel (modals can cause a lot of shadowing/unshadowing)
local function disable(self,isModal)

from hammerspoon.

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.