Doubt related to key code VK_PASTE
Hi All
Is the value of keycode returned by VK_PASTE correspond to the case when user presses CTRL+V
i had written a line of code as
if(e.getKeyCode == e.VK_PASTE)
{
System.out.println(" PASTE ");
}
I expected it to go inside IF statement on pressing CTRL+V
but it didnt happen
any other way out to catch CTRL+V event
Thanks in advance
[412 byte] By [
Arti_mda] at [2007-10-2 5:49:06]

yes, infact all 3, keypressed, keyreleased and keytyped are triggered when you try to paste.
This is what I found out: Ctrl V will result in KeyChar having an int value of 22 (because V is the 22nd alphabet). Likewise, Ctrl C will result in KeyChar having an int value of 3 (because C is the 3rd alphabet). You can try other Ctrl-alphabet and you will get the corresponding int value of the alphabet sequence.
In all cases, the keycode has int value of 0.
Some keyboards (esp. those made by Sun) have Cut, Copy and Paste keys, and VK_CUT, VK_COPY and VK_PASTE are only generated when those keys are pressed.