首页 > 解决方案 > 角上的简单键盘

问题描述

我想制作一个简单的键盘,它发出键盘事件以输入所选的输入元素流动的场景对我不起作用它调度事件放置不要在输入中写入数字

  const e = new KeyboardEvent('keypress', {
    bubbles: true,
    key: '1'
  });
  document.activeElement.dispatchEvent(e);
  event.preventDefault();

任何解决此问题的建议或任何替代方法来制作在多个输入字段中写入的简单键盘

This interface will be used via the touch screen only, so I need a keypad to enter the numbers

标签: angularkeyboard-eventsinput-field

解决方案


推荐阅读