Inkscape.org
Using Inkscape with Other Programs Disabling Rotate Canvas with AutoHotKey
  1. #1
    joshcraft3d joshcraft3d @joshcraft3d
    *

    Since the addition of Rotate canvas, and the ability to not disable it.... I made an AutoHotKey script that will intercept Ctrl+MMB, and just send MMB instead. The script will only work while you are in Inkscape as well. You would just need to have AutoHotKey installed to utilize this script. You can find out more about it at their site : https://www.autohotkey.com/

    Here is the code for the AutoHotKey Script, I will also attach the .ahk file for it:

    #NoEnv  ; Recommended for performance and compatibility with future AutoHotkey releases.
    ; #Warn  ; Enable warnings to assist with detecting common errors.
    SendMode Input  ; Recommended for new scripts due to its superior speed and reliability.
    SetWorkingDir %A_ScriptDir%  ; Ensures a consistent starting directory.

    #If inkscapeActive()

    ^MButton::
            SEND, {MButton Down}
        Return

    MButton Up::
            SEND, {MButton Up}
        Return

    inkscapeActive() {
        return WinActive("ahk_exe inkscape.exe")
    }

  2. #2
    novmikvis novmikvis @novmikvis

    Thank you for posting this! It is the only working solution for disabling rotation of canvas when pressing middle mouse button after zooming around in Inkscape 1.0
    However in order to make it work for me I had to add "^" befiroe "MButton Up::" in lne 12.
    So the resulting code that worked for me looks like this:

    #NoEnv  ; Recommended for performance and compatibility with future AutoHotkey releases.
    ; #Warn  ; Enable warnings to assist with detecting common errors.
    SendMode Input  ; Recommended for new scripts due to its superior speed and reliability.
    SetWorkingDir %A_ScriptDir%  ; Ensures a consistent starting directory.
    #If inkscapeActive()
    ^MButton::
            SEND, {MButton Down}
        Return
    ^MButton Up::
            SEND, {MButton Up}
        Return
    inkscapeActive() {
        return WinActive("ahk_exe inkscape.exe")
    }
  3. #3
    rawaa rawaa @rawaa

    hello, 

    can u help with writing Autohotkey to repeat the last operation in inkscape?

    how can i create such a hotkey?

    thanks in advance

  4. #4
    joshcraft3d joshcraft3d @joshcraft3d

    Unfortunately I am not that adapt with AutoHotKey. If there was a base function in inkscape that already did that, I could probably work one up.

    As it is right now, the script would have to monitor every action /click, store it in memory to then be called on to repeat the last so many clicks or actions once a key combination is pressed.

    That is way out of my league, heh. Sorry about that. Would be nice if the Inkscape Dev's made a repeat last command into the program, I see it has been requested for a while.