There's no trick or scripting needed for long pressing with G940. I use the profiler, not the in-game mapping. Map the button you want. If it calls for a long or short stroke, then that's what you do. Hold the button down for long stroke command or quick push of the button for a short command. I didn't have to do any scripting changes for my profile I created.