Menu

Keyboard shortcut for toggling source/preview

TXS - Help
2012-09-22
2012-10-17
  • Nathan Carter

    Nathan Carter - 2012-09-22

    Is there a keyboard shortcut for toggling keyboard focus from the source
    window to the preview window? I could find no such menu command that would
    enable me to make a keyboard shortcut for it. This is a rather central
    activity, so I'm suspecting that there is one. (Not everyone uses the mouse
    for preview navigation, right?)
    Nathan

     
  • Tim Hoffmann

    Tim Hoffmann - 2012-09-22

    I don't think there currently is one for the embedded viewer because it's been
    added just recently. For the windowed viewer you can use Alt+Tab.

     
  • Nathan Carter

    Nathan Carter - 2012-09-23

    OK. On the Mac it's even simpler, Cmd+` when they're two separate windows. But
    as you say, there's no shortcut key for when they're united into the same
    window. That's too bad, because uniting them into the same window and going
    full-screen is a great way to focus on just the one project, especially if
    you're using a large screen. Such a keyboard shortcut would be an important
    boon to such a use case.

     
  • Tim Hoffmann

    Tim Hoffmann - 2012-09-23

    What would be a good key combination for that? Ctrl+Shift+Tab?

     
  • Benito van der Zander

    Ctrl+Shift+Tab?
    That is already "previous document"

    Texmaker has Ctrl+Space, but that is even worse

    But you can write a user script for that:

    %SCRIPT
    if (editor.focus && pdfs.length > 0)
    pdfs.widget().setFocus();
    else
    editor.setFocus()

    On 09/23/2012 11:04 AM, SourceForge.net wrote:

     
  • Tim Hoffmann

    Tim Hoffmann - 2012-09-23

    Ctrl+Shift+Tab?
    That is already "previous document"
    Didn't work with me. (Ctrl+Tab) is next docuement, but Ctrl+Shift+Tab just
    inserts a tab. Fixed by changing ctrl+shift+backtab to ctrl+shift+tab.

    But you can write a user script for that:
    Still I consider it an elementary feature, that we should provide, not only by
    script. What about Alt+Left/Right?

     
  • Nathan Carter

    Nathan Carter - 2012-09-24

    Well, consider this as a different issue than just the embedded viewer,
    actually. For instance, if you have open several documents, and you have open
    several previews, you want a shortcut key that toggles back and forth between
    source and preview. In TeXShop, for instance, this is Cmd+1 (Mac). This
    keystroke makes sense because it's right next to Cmd+`, which is the OS-wide
    shortcut key on Mac for cycling through all windows. Cmd+1 is the special case
    that's useful in an application like a TeX GUI where many windows exist in
    pairs and have a corresponding partner that we want to very frequently toggle
    back and forth between.

    In short, you want a keystroke that will switch between a TeX document and its
    typeset version (both ways) regardless of whether the user has chosen embedded
    view or separate windows.

    I'm very intrigued about the user scripting capabilities, though. I found the
    documentation for it and am glad I did--great to know! More power for geeks.

     
  • Tim Hoffmann

    Tim Hoffmann - 2012-09-25

    This keystroke makes sense because it's right next to Cmd+`
    Sorry, but by far not on all keyboard layouts.

    And on windows this is unusable, as Cmd is equivalent (if any) to Win, and
    Win+1 is reserved.

    Yesterday I've implemented commands Focus Editor/Focus Viewer and assigned
    Alt+Left, Alt+Right. We're really running out of reasonalbe shortcut keys, but
    you can redefine them, if you want others. The advantage is that Focus Editor
    also works no matter on what control your focus has previously been. Focus
    viewer tries to find the correct viewer for the currently edited document. The
    reverse sets focus just to the last used editor.

     
  • Nathan Carter

    Nathan Carter - 2012-09-25

    Sure, that makes sense. I wasn't suggesting you had to do it the Mac way, just
    giving an idea of a particular use case/workflow. What you've done sounds like
    it will work well. I look forward to seeing it in a release. Thanks!

     

Log in to post a comment.