输入输入时,检查INSERT模式是否为ON [英] Check if INSERT mode is ON when typing in an input

查看:85
本文介绍了输入输入时,检查INSERT模式是否为ON的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试计算各种事件的输入字段的值,而不管捕获的事件是什么。

I'm trying to calculate the value of an input field on various events regardless of the event caught.

我正在考虑事件 keypress keyup keydown cut paste events(我忘了​​什么吗?)。

I'm taking into account the events keypress keyup keydown cut paste events (Do I forget anything?).

我正在尝试确定文本输入是否正确 INSERT 模式已启用(默认 - 开启)或关闭。我无法通过捕获该密钥的关键事件来确定模式,但我不知道初始状态是什么。

I'm trying to determine if the text-input INSERT mode is on (default - on), or off. I cannot determine the mode by capturing a key event of that key, though I don't know what was the initial state.

有没有人知道方法?最好是 - 包含IE8 +,Chrome和FF的跨浏览器解决方案。

Does anyone know a way? Preferably - a cross browser solution that includes IE8+, Chrome and FF.

任何解决方案,或者用Barney Stinson的话说,诈骗,骗局,喧嚣,蒙骗,开局,flim flam,stratagem和bamboozle可以帮助我。

Any solution, or in the words of Barney Stinson, "scam, con, hustle, hoodwink, gambit, flim flam, stratagem, and bamboozle" that could help me would be appreciated.

提前致谢。

推荐答案

仅适用于IE:

document.queryCommandValue("OverWrite");

据我所知,Firefox和Chrome没有覆盖模式。插入键在这些浏览器中不起作用,并且它们始终处于插入模式

As far as I know, Firefox and Chrome don't have overwrite mode. The insert key doesn't work in those browsers, and they are always in insert mode.

此外,Mac键盘没有从头开始插入键。因此,Safari也始终处于插入模式

Moreover, Mac keyboard doesn't have a insert key from the beginning. So Safari also is always in insert mode.

这篇关于输入输入时,检查INSERT模式是否为ON的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆