sd4zhb

浏览器上实现按键模拟,是行不通吗

  •  
  •   sd4zhb · Jul 25, 2019 · 2735 views
    This topic created in 2568 days ago, the information mentioned may be changed or developed.

    想实现在 input 标签中按<ctrl>+n 等同于按方向键<down>(同 emacs 一般)。
    试了实例化 KeybordEvent,然后target.dispatchEvent(event)触发事件,但这方法只能触发绑定的事件,无法触发按键的默认行为(字符输入)。
    是不是浏览器中无法实现这种模拟?
    借助浏览器的扩展是否能够实现?
    请大佬指点一二,感谢!

    No Comments Yet
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   5371 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 54ms · UTC 08:07 · PVG 16:07 · LAX 01:07 · JFK 04:07
    ♥ Do have faith in what you're doing.