Very difficult key codes!
-
hello all
First sorry for my poor English:)three days since I am fighting with the shortcut.
I want to delete the paths in the plugin camerakeymaker with the shortcut ALT + DELETEIn the MAC OSX (ALT + DELETE) it's available only on onKeyUp and work fine
on the PC it's available on the onkeyDow AND onkeyup.But in the pc it does not work correctly on onkeyup
onkeyup; if ((key == VK_DELETE) && ((flags & VK_ALT) == VK_ALT)) p "OnKeyDown; DELETE PATH" .... endWhen I press (alt + delete) or (delete only) it pass in statement
do you can help me ???
best regard
-
@unknownuser said:
(http://forums.sketchucation.com/viewtopic.php?f)":dwixdyu1]
I haven't been able to trigger a VK_ALT on either system.
-
I was never able to catch VK_DELETE under Windows...
-
I would say that straightforward simplicity is the lowest form of elegance.

-
@macgile said:
In the MAC OSX (ALT + DELETE) it's available only on onKeyUp and work fine
on the PC it's available on the onkeyDow AND onkeyup.Here is what I find, under Windows:
When only
Deleteis pressed, it triggers onlyonKeyUp.
WhenShift+Deleteis pressed, it onlyonKeyUp.
WhenCtrl+Deleteis pressed, it triggers bothonKeyDownandonKeyUp.
WhenAlt+Deleteis pressed, it triggers bothonKeyDownandonKeyUp. -
@thomthom said:
@macgile said:
In the MAC OSX (ALT + DELETE) it's available only on onKeyUp and work fine
on the PC it's available on the onkeyDow AND onkeyup.Here is what I find, under Windows:
When only
Deleteis pressed, it triggers onlyonKeyUp.
WhenShift+Deleteis pressed, it onlyonKeyUp.
WhenCtrl+Deleteis pressed, it triggers bothonKeyDownandonKeyUp.
WhenAlt+Deleteis pressed, it triggers bothonKeyDownandonKeyUp.Thank's thomthom
thank you it is very useful


-
oups
fix for mac :
K_CTRL_ALT = VK_CONTROL.to_s << VK_ALT.to_s
K_ALT_DEL = VK_ALT.to_s << VK_DELETE.to_sonKeyUp
#window || mac (on mac, delete it triggers only in onKeyUp)
if(@flags == K_ALT_DEL || (@flags + key.to_s) == K_ALT_DEL))do something
end
-
hi Dan Rathbun,
first thank's to reply

i have found this solution
windows :
K_CTRL_ALT = COPY_MODIFIER_KEY.to_s << ALT_MODIFIER_KEY.to_s
K_ALT_DEL = ALT_MODIFIER_KEY.to_s << VK_DELETE.to_smac:
K_CTRL_ALT = VK_CONTROL.to_s << VK_ALT.to_s
K_ALT_DEL = VK_ALT.to_s << VK_DELETE.to_s@flags =""
CTRL + ALT or ALT + DEL
def onKeyDown(key, repeat, flags, view)
SAVE KEY to string
@flags += key.to_s
enddef onKeyUp(key, repeat, flags, view)
if (@flags == K_CTRL_ALT)
do something
end
#window or mac (on mac, delete it triggers only in onKeyUp)
if(@flags == K_ALT_DEL || (@flags + key.to_s) == K_ALT_DEL))do something
end
@flags = ""
endit's not "très élégant" but it works with any key combination
best regard
-
@thomthom said:
Here is what I find, under Windows:
When only
Deleteis pressed, it triggers onlyonKeyUp.
WhenShift+Deleteis pressed, it onlyonKeyUp.
WhenCtrl+Deleteis pressed, it triggers bothonKeyDownandonKeyUp.
WhenAlt+Deleteis pressed, it triggers bothonKeyDownandonKeyUp.I'm unable to access my mac atm. Anyone able to run this on Mac and check the results? I'm curious if VK_DELETE register on key down under OSX.
-
Also note that
TABon MAC only fires withonKeyUpand is ignored otherwise !
The TAB key == 9 or 15 or 48 [for PC or MAC or ??]
Hello! It looks like you're interested in this conversation, but you don't have an account yet.
Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.
With your input, this post could be even better 💗
Register LoginAdvertisement