#328 ShortCut OptionPane:mouse wheel + modifiers bound to actions

open
nobody
core (195)
5
2014-03-18
2010-01-17
Anonymous
No

I would be nice to add this feature. Zooming by pressing CTR button and scrolling mouse.

Discussion

  • Dale Anson
    Dale Anson
    2010-01-18

    Here's a couple of macros that I use to "zoom" (increase/decrease the font size of) the text area. I have them assigned to Ctrl + = and Ctrl + -, which is the same key combination that Firefox uses to increase or decrease the font size. Just save these to your ~/.jedit/macros directory, then go to Utilities - Global Options - Shortcuts to assign the keyboard shortcuts. I don't know how these could be assigned to mouse actions.

    Inc_Font.bsh:

    public void incFont() {
    java.awt.Font font = textArea.getPainter().getFont();
    String name = font.getName();
    int size = font.getSize() + 1;
    int style = font.getStyle();
    font = new Font( name, style, size );
    SwingUtilities.invokeLater(
    new Runnable() {
    public void run() {
    jEdit.setFontProperty( "view.font", font );
    org.gjt.sp.jedit.EditBus.send(new org.gjt.sp.jedit.msg.PropertiesChanged(null));
    }
    }
    );
    }

    incFont();

    ----------

    Dec_Font.bsh:

    public void decFont() {
    java.awt.Font font = textArea.getPainter().getFont();
    String name = font.getName();
    int size = font.getSize();
    size = size > 1 ? size - 1 : 1;
    int style = font.getStyle();
    font = new Font( name, style, size );
    SwingUtilities.invokeLater(
    new Runnable() {
    public void run() {
    jEdit.setFontProperty( "view.font", font );
    org.gjt.sp.jedit.EditBus.send(new org.gjt.sp.jedit.msg.PropertiesChanged(null));
    }
    }
    );
    }

    decFont();

     
  • Alan Ezust
    Alan Ezust
    2010-01-18

    There are macros already that let you increase/decrease font size, under "Macros/Interface", which also increase/decrease the console and gutter font sizes.

    But as far as I know, there is no way to bind the mouse wheel to actions in jEdit, is there?

    It would be nice if we could bind wheel movements and ctrl+wheel movements to any action or macro, like we can with other keystrokes.

     
  • Alan Ezust
    Alan Ezust
    2010-01-18

    • labels: 1026105 --> core
    • summary: mouse wheel + modifiers bound to actions --> ShortCut OptionPane:mouse wheel + modifiers bound to actions