Oh yes, Menu, Show will halt execution like a MsgBox would. That was my mistake.
Option 1:
I'm wondering if the tablet is register a click outside of the menu (or even selecting a menu item) as soon as the Menu Shows. You may want to try using a
Sleep before the
Menu, MyMenu, Show command. For the sake of experimentation and diagnostics, try a
Sleep 3000. A good 3 seconds should leave you enough time to move the pen away from the tablet and observe anything odd going on.
Option 2:
Are you able to make this script run persistently and use a hotkey to trigger the
Menu, MyMenu, Show? i.e.
Code: Select all
#singleinstance force
Menu, Mymenu, Add, AAAA, MenuHandler
Menu, Mymenu, Add, BBBB, MenuHandler
Menu, Mymenu, Add, CCCC, MenuHandler
return
vk01sc001:: ; or whatever name your tablet button hotkey may have to AHK
Menu, MyMenu, Show
return
MenuHandler:
MsgBox You selected %A_ThisMenuItem%
Menu, MyMenu, Delete
return
But if it's like how I remember my tablets having dedicated tapping areas -- "flat buttons" if you will -- then that may not work. It'd be a lot trickier to identify.
Below is code I was testing for myself. I did my testing without a tablet; I have a Wacom tablet but it's packed away.
Code: Select all
^5::
Menu, MyMenu, Add, Test, Test
Menu, MyMenu, Show
MsgBox World
return
Test:
MsgBox Hello
return