Mouse-only SketchUp navigation AHK script
-
I can't see a more suitable board but I suppose this counts as an extension.
I got sick of using SHIFT-MOUSEWHEELCLICK to pan so I wrote this tiny AutoHotKey script.
It simply transforms the mouse forward and back buttons into a pan button by simulating SHIFT-MOUSEWHEELCLICK.
Obviously it's only of use if you have a mouse with side buttons on it and have downloaded AutoHotKey.SetTitleMatchMode, 2 #IfWinActive SketchUp *XButton1;;Send {Shift Down}{MButton Down} *XButton2;;Send {Shift Down}{MButton Down} return #IfWinActive *XButton1 Up;;Send {Shift Up}{MButton Up} *XButton2 Up;;Send {Shift Up}{MButton Up}
It's made my life a lot easier - hope it helps you too.
-
Hummmm, seems nice, have to try it ! Thanks
Edit : Any tips on How to use that script ? is this a ruby script ?
Edit 2 : Put that script in a ruby file and it gives me the following errors :
Erreur de chargement du fichier autohotkey.rb C;/Program Files (x86)/Google/Google SketchUp 8/Plugins/autohotkey.rb;1; syntax error, unexpected '\n', expecting tCOLON2 or '[' or '.' C;/Program Files (x86)/Google/Google SketchUp 8/Plugins/autohotkey.rb;3; syntax error, unexpected '{', expecting '=' *XButton1;;Send {Shift Down}{MButton Down} ^
-
It's NOT a Ruby.
@unknownuser said:
...Obviously it's only of use if you have a mouse with side buttons on it and have downloaded AutoHotKey...
This needs a 3rd party system tool called 'AutoHotKey' to have been install [it automates things with key/mouse clicks in specific applications] and the code added into a script for that - also it's dependent on the type of mouse...
-
@panga said:
Edit : Any tips on How to use that script ? is this a ruby script ?
Edit 2 : Put that script in a ruby file and it gives me the following errors...It's an AutoHotKey script as it has to access rather obscure mouse button presses.
You can save it to a file with an AHK extension and then download AutoHotKey from http://www.autohotkey.com/download/ to execute it.
Alternatively, I have attached a zip file that contains the AHK file and a compiled EXE in case you prefer to just virus-check and run rather than use AHK. The icon to close it once running appears as a green "H" in your system tray.
Sadly I went to work today and tried it with my Logitech mouse to find it did not work, despite it working fine for my Microsoft and 3rd-part mice at home. It seems that AHK sends an instant button-up after the button-down event of logitech mice when using the browser buttons. Because of this I created a seperate AHK and EXE file to use only if the Microsoft one doesn't work for your mouse.
Regretably, because actually releasing the button doesn't generate an event for these mice, all I can do is get the forward/back button clicks to toggle between turning pan mode on and off in Sketchup. This isn't anywhere near as nice as the Microsoft mouse version (where holding either button and moving the mouse pans until you release it) but it's better than nothing.
I hope you manage to get it working for you - let me know if you have any more issues and I'll see what I can do.
-
Thanks eviloverlord ! I'll try to find some time today to test it with my G5 from logitech.
Cheers.
Edit : I made a quick try and with the logitech script : The first click activate the scrit, and a second one desactivate it. With the microsoft script, the script is desactivated as soon as I release the button. So it works well for me. I think that both script can be usefull.
Could it be possible to enlager the functionnality of this tool, by affecting SHIFT to the first side button, and CONTROL to the second one in order to use them with the other tools of SU ?
-
@panga said:
Could it be possible to enlager the functionnality of this tool, by affecting SHIFT to the first side button, and CONTROL to the second one in order to use them with the other tools of SU ?
Sure - not a problem at all. The attached version maps the back button to SHIFT and the forward one to CTRL.
I only did a microsoft version as the logitech behaviour makes less sense for this one (if both buttons are pressed in turn do you turn on both modifier keys or cancel the first one?).
Hope it proves useful.
-
I'll try it now and give you feedback soon. Thanks a lot !
Advertisement