短篇小说:如何从JavaScript模拟在CKEditor的DEL按键
// get the editor instance
var editor = CKEDITOR.instances.editor1;
// this is what I want, but it does not exist
editor.execCommand('delete');
// I've played with this, found somewhere, but without success.
editor.fire('key', { keyCode : 46 })
长的故事:
有利用.NET WindowsForms WebBrowser控件中的CKEditor当问题。几个键,包括DELete键根本不会传播到控件。
我设法拦截使用全局键盘钩子的密钥,并将窗口消息直接发送到嵌入式IE窗口句柄,但没有成功。
现在我的目标是模拟JavaScript中的删除键,因为我可以从我的.NET应用程序调用js函数。 不知何故,这必须工作,因为它在虚拟键盘插件内工作。 (请参阅sample)
很遗憾,我无法从插件代码得知它是如何工作的。 如果有人可以发布工作示例,我会很高兴。
谢谢!