I have two custom text styles, Code and Menuitem, that allow me to change the appearance of a selected string of text via the right-click - Text Style menu.
But applying the styles often is a lot of mouse work, and I should like to be able to affect a key shortcut, like CTRL + e for Emph, to both of these styles.
When I apply them via the menu, the status bar at the bottom of my interface shows
flex-insert "menuitem"
or
flex-insert "code"
So I tried binding these lines to keyboard shortcuts via the Tools - Preferences - Editing - Shortcuts menu. (Yes, I did RTFM.)
Everything compiled ok, but this does not have the desired effect. The selected text just appears in italics. For the record, "code" should put it into the typewriter font and "menuitem" should put it into a small caps sans serif. Neither is italics. I used the shortcut CTRL + m after removing the math mode shortcut which I never use.
Thanks to anyone who can help.
EFR
LyX ⇒ Shortcut for custom text style
NEW: TikZ book now 40% off at Amazon.com for a short time.

-
- Site Moderator
- Posts: 542
- Joined: Sat Sep 01, 2012 6:38 am
Re: Shortcut for custom text style
I don't know why that didn't work. A good way of testing is to enter those commands into the mini-buffer (alt+x for default bindings). If they work there, then bind them to a short cut.
Also, if you start lyx with -dbg action, it will show all of the lyx functions, which can be used to discover the short cut.
Finally, you might need to use 'command-sequence' which lets you run several LFUNS at once. See Help > LyX Functions for a list of many LFUNS.
Scott
Also, if you start lyx with -dbg action, it will show all of the lyx functions, which can be used to discover the short cut.
Finally, you might need to use 'command-sequence' which lets you run several LFUNS at once. See Help > LyX Functions for a list of many LFUNS.
Scott
Re: Shortcut for custom text style
Thanks Scott, for that mini-buffer tip. In fact, the flex-insert command worked correctly, but I was not respecting case-sensitivity. My commands were called MenuItem and Code, not menuitem and code. So now all is well and I will have to apply myself to figuring out how to use the LFUNS.