[Ipe-discuss] Shortcut for toggling bookmarks panel?

Bläsius, Thomas (ITI) thomas.blaesius at kit.edu
Tue Jul 4 08:15:44 CEST 2023


Not sure whether this is the most elegant option, but you could solve
this via a small ipelet:

-- bookmark.lua ------------------------------------------------------

label = "Bookmarks"

local visible = false;

function toggle_bookmarks(model)
   visible = not visible
   model.ui:showTool("bookmarks", visible)
   model:setBookmarks()
end

methods = {
  { label = "toggle bookmarks", run=toggle_bookmarks },
}

----------------------------------------------------------------------

Then you can define the shortcut in the customization file like so:
shortcuts.ipelet_1_bookmark = "Ctrl+Alt+b"


Two additional comments:

- I'm not sure how to check whether the bookmarks are currently
  visible. So the above solution will not know when you have changed the
  state via the ui and will potentially not toggle once (e.g., it tries
  to hide although it is already hidden). From the
  MODEL:action_toggle_bookmarks() method, it looks like one should be
  able to get the current state via something like
  self.ui:actionState("toggle_bookmarks") but I did not get this to
  work.

- Also I am not sure what the model:setBookmarks() call is there for (I
  just copied it from the MODEL:action_toggle_bookmarks() method).


Jacob Barandes via Ipe-discuss <ipe-discuss at lists.science.uu.nl> writes:

> I can't seem to find a way to bind a keyboard shortcut to toggle the
> bookmarks panel. There doesn't appear to exist a
> "shortcuts.toggle_bookmarks" property (or something like it) that I can set.
>
> I've checked the mailing list archives, but haven't found anything.
>
> Is there some way to do this that I'm not understanding?
>
> Please excuse any ignorance on my part, and thanks so much!
> _______________________________________________
> Ipe-discuss mailing list
> Ipe-discuss at lists.science.uu.nl
> https://mailman.science.uu.nl/mailman/listinfo/ipe-discuss


More information about the Ipe-discuss mailing list