让计算机认为点击时按下了一个键

Make computer think a key is pressed on click

所以我正在寻找的是当您按下按钮或 link 输出时计算机认为您按下了空格键。

您没有指定任何语言OS,但是对于c#您可以使用:

SendKeys.Send("{ENTER}");

How to: Simulate Mouse and Keyboard Events in Code


使用 jQuery 您可以模拟按键(空格键 / 32):

<button id="test">Test ME</button>

$('#test').trigger(jQuery.Event('keypress', {which: 32}));