I have been doing audio editing for side project at work. These are long form audio recordings of an hour or more. I am using Adobe Audition to do my editing. After doing several of these, I noticed that I use two main functions frequently.
‘Ripple Cut’ -> ‘ Time Selection in All Tracks’
The ripple cut function either used a significant number of mouse clicks or keyboard shortcuts that required both hands. There are probably a few different potential solutions to this problem. I could have changed the keyboard shortcuts to something else, but I wanted this to be easy to use and I wanted to be able to use it on any computer.
PyPortal is a microcontroller that can be programmed using CircuitPython. It has a touchscreen and can be used as a emulate a keyboard and mouse. For this project, we will create a touchscreen with icons that will allow us to launch applications when pressed.
Design: discussions how the touchscreen image and layout are created.
Shortcuts: Create Keyboard Shortcuts to Launch Applications in macOS ( Windows)
Code: CircuitPython code to be added to you PyPortal
The PyPortal initializes rendering a background image that is .BMP (bitmap image). So I created a template background image that I could insert icons into using Adobe Illustrator. Using this file, I copied and pasted my icons on to the location I wanted and then deleted the while squares underneath.
In order to detect button presses we need to know the boundaries for each icon. The image below shows the pixel length to each border.
Columns are organized from left to right, from A to D. Rows are organized from top to bottom, from 1 to 3. Please see the below table.
We need to know this information in order to determine if an icon is pressed. A touch event returns an (x,y) point with (0,0) being the top left corner. All icons in column B can only be pressed if the x of the touch event is between 97.5 and 147.5. Likewise, all icons in row 1 can only be pressed if the y of the touch event is between 100 and 150. Therefore, if the touch event returns (100,130), then the icon located at B2 has been pressed.
The easiest way to launch applications using CircuitPython is by sending keyboard commands to your computer. In order to accomplish this on a macOS we need to create these keyboard shortcuts. This is fairly trivial on windows.
Launch Automator on your mac
Create a new “Quick Action”
File -> New -> “Quick Action” -> Choose
Under actions search for “Launch Application”
Drag “Launch Application” into the window
From the drop down list select the application that you want to open
Switch the “Workflow Receives” drop down to “no input”
Save your quick action
Either CONTROL+S or File -> Save
Create the keyboard shortcut to activate the “Quick Action” you created
Go to Settings -> Keyboard
Click on the Shortcuts tab
Scroll to the General section near the bottom.
Highlight the “Quick Action” you created and click the Add Shortcut button.
Press the keyboard keys that you want to set the shortcut to.
I used “ALT+CONTROL+SHIFT+COMMAND+[FIRST LETTER OF APP]” for each of my shortcuts. I did this because I knew there would be no other shortcuts using this combination.
The code has comments throughout and they should explain everything. If you have questions please feel free to email me or DM me on twitter. You will need to copy the below code as code.py in the root of your PyPortal as well as you BMP icon file. Please update the below code with your keyboard shortcuts and the name of your BMP icon file.
No Starch Press is here with a bundle of books flung over their back, Santa-style. Get Serious Cryptography: A Practical Introduction to Modern Encryption, Black Hat Python, Android Security Internals, and more. Happy hacking holidays to you!
The Tangled Web: A Guide to Securing Modern Web Applications – Michal Zalewski
Silence on the Wire: A Field Guide to Passive Reconnaissance and Indirect Attacks – Michal Zalewski
Metasploit: A Penetration Tester’s Guide – David Kennedy, Jim O’Gorman, Devon Kearns, and Mati Aharoni
The Car Hacker’s Handbook: A Guide for the Penetration Tester – Craig Smith
Practical Forensic Imaging: Securing Digital Evidence with Linux Tools – Bruce Nikkel
Pay $8 or more to also unlock
Android Security Internals: An In-Depth Guide to Android’s Security Architecture – Nikolay Elenkov
Gray Hat C#: A Hacker’s Guide to Creating and Automating Security Tools – Brandon Perry
Practical Malware Analysis: The Hands-On Guide to Dissecting Malicious Software – Michael Sikorski and Andrew Honig
iOS Application Security: The Definitive Guide for Hackers and Developers – David Thiel
Black Hat Python: Python Programming for Hackers and Pentesters – Justin Seitz
Pay $15 or more to also unlock
Pentesting Azure Applications: The Definitive Guide to Testing and Securing Deployments – Matt Burrough
Hacking: The Art of Exploitation, 2nd Edition – Jon Erickson
Serious Cryptography: A Practical Introduction to Modern Encryption – Jean-Philippe Aumasson
Penetration Testing: A Hands-On Introduction to Hacking – Georgia Weidman
Attacking Network Protocols: A Hacker’s Guide to Capture, Analysis, and Exploitation – James Forshaw
35% Off Select Print Editions at No Starch Press
While I certainly am, some of our fans are not EFF fans. For those of you, please know that I’ll be giving a good chunk of change from our Humble Bundles to The No Starch Press Foundation (https://t.co/UV2JyP1f8Y) — thanks to you! @nostarch