Hello,
when I am using application.getLastKeyModifiers() I am getting rather strange results. When holding ALT for example, the function returns 24 insted of the stated 8.
Am I doing something wrong here or is there a bug?
Thanks
Patrick
Hello,
when I am using application.getLastKeyModifiers() I am getting rather strange results. When holding ALT for example, the function returns 24 insted of the stated 8.
Am I doing something wrong here or is there a bug?
Thanks
Patrick
it is a bit wise return number (alt,ctrl are all in that number)
you have to test if it is the alt key
altkey = returnCode&8==8
see the sample code!
I can’t really follow…
All I want is to check if somebody holds the alt key while pushing a button. 24 is returned, so if I check for 24 everything works fine. But I don’t know why… Could you give some more explanation?
Sorry for stealing your time.
Thanks
Patrick
please look at my code
to check if the ALT key was pressed you have to check for the fiels value if the ALT_MASK (thats what it is called is in the value)
so you have to do:
var altKeyPressed = thevalue&8==8;
if(altKeyPressed)
{
// the alt key was pressed.
}
please look at the sample code because it is explained there.
the value you get from the call getLatModifiers() can also hold the CTRL key with the ALT key so it will not be a 8 or something but a number that “holds” both the 8 of the alt and the other numbers of the META or the CTRL key…