|
|
pinEdit WP
Started by DavidP at 03-14-2008 1:00 . Topic has 8 replies.
 
 
|
|
Sort Posts:
|
|
|
|
03-14-2008, 1:00
|
DavidP
Joined on 09-10-2007
Posts 17
|
Manually execute "backspace" or "delete" call?
|
|
|
|
|
Is there a way to, from code, simulate "backspace" or "delete" key presses by calling a function or something?
I'm using the ActiveX component of the pinEditor.
|
|
|
|
|
Report
|
|
|
|
03-14-2008, 2:27
|
Pintexx Support
Joined on 08-30-2005
Posts 1.571
|
Re: Manually execute "backspace" or "delete" call?
|
|
|
|
|
|
|
|
03-18-2008, 5:10
|
DavidP
Joined on 09-10-2007
Posts 17
|
Re: Manually execute "backspace" or "delete" call?
|
|
|
|
|
So there is no way to, in code, remove the previous or next character? Okay.
Then i wonder, is there a way to capture the backspace and delete key presses to do a custom action?
|
|
|
|
|
Report
|
|
|
|
03-19-2008, 9:37
|
Pintexx Support
Joined on 08-30-2005
Posts 1.571
|
Re: Manually execute "backspace" or "delete" call?
|
|
|
|
|
Hi,
please try editor_keydown event.
Regards,
Hans-Peter
|
|
|
|
|
Report
|
|
|
|
03-31-2008, 1:14
|
DavidP
Joined on 09-10-2007
Posts 17
|
Re: Manually execute "backspace" or "delete" call?
|
|
|
|
|
Hi.
I'm sorry but the EditorKeyDown event doesn't send the KeyCode for backspace key presses. It's said to be a control key but there's no way to verify if the key pressed was backspace or not. Can i somehow alter the code to allow this?
|
|
|
|
|
Report
|
|
|
|
03-31-2008, 1:54
|
DavidP
Joined on 09-10-2007
Posts 17
|
Re: Manually execute "backspace" or "delete" call?
|
|
|
|
|
And is it possible to cancel keypresses somehow?
I'm trying to create a workaround which will remove a selected object (i.e. an object selected for resizing). Maybe there's an easy way to do this?
|
|
|
|
|
Report
|
|
|
|
03-31-2008, 5:22
|
Pintexx Support
Joined on 08-30-2005
Posts 1.571
|
Re: Manually execute "backspace" or "delete" call?
|
|
|
|
|
Hi,
no it's not possible to cancel key press.
Please try this:
editor.execute("editGetActiveObject().removeNode(true)")
Regards,
Hans-Peter
|
|
|
|
|
Report
|
|
|
|
03-31-2008, 5:30
|
DavidP
Joined on 09-10-2007
Posts 17
|
Re: Manually execute "backspace" or "delete" call?
|
|
|
|
|
Sure, thanks, but i've already tried it and it works fine. However, i only want to remove the selected object if there's an object selected, and only otherwise i want to do a regular backspace/delete. Can that solution be expanded to solve this?
|
|
|
|
|
Report
|
|
|
|
04-01-2008, 8:32
|
Pintexx Support
Joined on 08-30-2005
Posts 1.571
|
Re: Manually execute "backspace" or "delete" call?
|
|
|
|
|
Hi,
you can find out if there is a selection by using
editor.document.createRange()
You have to add mshtml.dll as reference.
Then you have full access to all objects.
But you can no initiate a backspace/delete this way.
You can only remove something if you select it by using Range object and then clear range.
Regards,
Hans-Peter
|
|
|
|
|
Report
|
|
|
|
|
|