I do most of my work with a pen on a touchscreen, this is the most comfortable way for me to work due to problems with my hands.
The UI for Moho isn't built for this, though. I've added extensions for a lot of things that really need to be in there, like undo/redo and deselect all, which save me a ton of time. But I could save so much more time if I had buttons for other things like delete. It seems like such a simple thing to implement, something even someone bad at scripting like me should be able to figure out, but I've had no luck.
Is it possible to make a script that simply inputs a key (or key combination) when tapped? If I could do that for at least the delete key it would save a lot of time, and if I could make a new one for any key or key combo then I could do most of my work without having to bring out the keyboard.
Need help turning simple things into extension buttons
Moderators: Víctor Paredes, Belgarath, slowtiger
- synthsin75
- Posts: 10253
- Joined: Mon Jan 14, 2008 11:20 pm
- Location: Oklahoma
- Contact:
Re: Need help turning simple things into extension buttons
If you're on Windows, you might try Greenlaw's MQC: viewtopic.php?f=9&t=32882#p189939
- Wes
Donations: https://www.paypal.com/paypalme/synthsin75 (Thx, everyone.)
https://www.youtube.com/user/synthsin75
Scripting reference: https://mohoscripting.com/
Donations: https://www.paypal.com/paypalme/synthsin75 (Thx, everyone.)
https://www.youtube.com/user/synthsin75
Scripting reference: https://mohoscripting.com/
Re: Need help turning simple things into extension buttons
Ah yes, that does help LOT, thanks! 
For future reference though, is there a way to script an extension that's just a key press or combination? I'm sure it'll come up again at some point. I've searched around a lot, but I guess it's something so simple that nobody's wanted to do it or needed any help to figure it out.

For future reference though, is there a way to script an extension that's just a key press or combination? I'm sure it'll come up again at some point. I've searched around a lot, but I guess it's something so simple that nobody's wanted to do it or needed any help to figure it out.

Re: Need help turning simple things into extension buttons
So far - my only solution to send keys from a Moho tool button back into Moho is to invoke an external Python script that sets focus back to Moho and then issues the desired key sequence.
Similar to below - which reloads Moho scripts:
Lua:
Code: Select all
cmd = 'python "' .. moho:UserAppDir() .. '/scripts/utils/ss_moho_reload.py"'
os.execute(cmd)
Code: Select all
import pyautogui
import pygetwindow as gw
wnd = gw.getWindowsWithTitle('.moho - Moho')[0]
wnd.restore()
wnd.activate()
pyautogui.hotkey('ctrl', 'alt', 'shift', 'l');
Moho 14.3 » Win 11 Pro 64GB » NVIDIA GTX 1080ti 11GB
Moho 14.3 » Mac mini 2012 8GB » macOS 10.15 Catalina
Tube: SimplSam
Sam
Moho 14.3 » Mac mini 2012 8GB » macOS 10.15 Catalina
Tube: SimplSam
Sam