Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Hotkeys to launch different modals #83

Open
ihodes opened this issue Mar 25, 2021 · 4 comments
Open

Hotkeys to launch different modals #83

ihodes opened this issue Mar 25, 2021 · 4 comments

Comments

@ihodes
Copy link

ihodes commented Mar 25, 2021

Is it possible to add to the below (basically, have multiple hotkeys which launch different modals)?

(local common-keys
        {:mods [:cmd :shift :alt :ctrl]
         :key :space
         :title "Apps"
         :items app-bindings})

(local config
       {:title "Main Menu"
        :items menu-items
        :keys  common-keys})
@jaidetree
Copy link
Collaborator

Not currently supported, or even anticipated but could be feasible. I'm going to prioritize #72 for now and then can look into this possibly after. If you wish to make a PR feel free to give it a shot 🙂

@Grazfather Grazfather changed the title Hotkeys to launch different models Hotkeys to launch different modals Sep 16, 2021
@Grazfather
Copy link
Collaborator

This shouldn't be difficult, and it makes sense to me.

A plan of attack:

  1. Have modal.activate-modal take a fsm as an arg. Probably default to the one locally defined in the module. (let [fsm (or _fsm fsm)])
  2. Take most of the functionality out of modal.init. Put it into some create-modal and make it return the fsm (+ cleanup func?)
  3. modal.init now basically does (set fsm (create-modal config))
  4. Whoever wants to define a separate modal menu system just creates one in their config and calls these functions manually e.g. (local mymodal (lib.modal.create-modal myfsm)) and binds a key to (fn [] (lib.modal.activate-modal mymodal))

@jaidetree
Copy link
Collaborator

jaidetree commented Sep 16, 2021

I don't think users should have to define custom state machines, more like the modal state machine should accept custom menu objects. I think there's an event on the modal state machine already like this that takes a submenu of the current modal to display that like when entering from Main -> Window.

With the advice system done, I should be able to make the required updates if needed to support this by the end of this weekend.

@jaidetree
Copy link
Collaborator

@ihodes Out of curiosity, what makes that feature more desirable than pressing cmd+space a to access the apps menu? Especially if you press cmd+space it will show "Apps ..... a`, where as this proposal means the binding is hidden.

@jaidetree jaidetree mentioned this issue Sep 28, 2021
7 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants