Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic How to trap "del key" click in JavaScrip (Read 3754 times)
just2click
YaBB Newbies
*
Offline


Go Sharks Go

Posts: 16
Joined: Oct 11th, 2006
How to trap "del key" click in JavaScrip
Oct 11th, 2006 at 5:01am
Print Post  
Hi,

I'm new here. I trying to add some feature related to the deletion of objects from the display.

I can't find an example of how to wire the event and trap it within JavaScript.

Any pointers?

Thanks,

Dror
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: How to trap "del key" click in JavaS
Reply #1 - Oct 11th, 2006 at 6:35am
Print Post  
Hi,

You will have to disable the standard keyboard processing if you wish to handle the Del key yourself. You must also set one of the KeyboardFlags that makes FlowChartX handle key-down messages through a COM interface instead of the Windows Message Queue:

<SCRIPT language="JavaScript">
function window_onLoad()
{
  fcx.KbdActive = false;
  fcx.KeyboardFlags(2) = true;
}
</SCRIPT>

<SCRIPT FOR="fcx" EVENT="KeyDown(keyCode, shift)">
  if (keyCode == 0x2E)
    alert("Del");
</SCRIPT>

I hope that helps,
Stoyan
  
Back to top
 
IP Logged
 
just2click
YaBB Newbies
*
Offline


Go Sharks Go

Posts: 16
Joined: Oct 11th, 2006
Re: How to trap "del key" click in JavaS
Reply #2 - Oct 15th, 2006 at 7:01am
Print Post  
Thanks  Stoyo Grin

I already did some of it. Does disabling the keboard affects any other key strocks handling?

Thanks again

Dror
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: How to trap "del key" click in JavaS
Reply #3 - Oct 16th, 2006 at 8:33am
Print Post  
Hi Dror,

That will also disable the clipboard combinations - Ctrl+X/C/V and the undo/redo ones - Ctrl+Z/Y.

Stoyan
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: How to trap "del key" click in JavaS
Reply #4 - Oct 21st, 2006 at 7:25am
Print Post  
Actually you don't have to set KbdEnabled = false to get the KeyDown event for Del. You only need to set EventFlags(fFireKeyDownOnDelete) = true. Thus you can still use the standard handling for the other keyboard shortcuts.

Stoyan
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint