Dear All,jmburnod wrote: ↑Thu Mar 29, 2018 6:42 pmHi,
I think you have to use keysdown function
The keysDown function returns a list of keycodes of pressed keys, separated by commas if more than one key is being pressed.
Something like that:end mousedownCode: Select all
on mousedown if the optionkey is down and the keysdown = 101,0 then answer "optionkey is down and you press e" -- e = 101 else "nothing happened" end if
You may get the keycode of a touch with this on card scriptBest regardsCode: Select all
on rawkeydown pKey put pKey end rawkeydown
Jean-Marc
I'm trying to implement a keyboard shortcut based on Jean-Marc's code above but I can't seem to be able to get it to work for me using the following code:
Code: Select all
on rawkeydown
-- I'm wanting an 'Alt S' shortcut
if the altkey is down and the keysdown is 115,0 then
answer "its worked"
else
pass rawkeydown
end if
end rawkeydown
Grateful for any tips.
Thanks,
Glenn
PS - apologies, I've just realised I'm probably causing confusion - I'm not wanting to assign a shortcut to a button (as the post title states!), but I'm wanting to have a general shortcut for a field, for example entering Alt S would trigger a 'save' function.