我正在尝试在Macbook os Mojave上模拟Enter键,但无法正常工作。这是我正在使用的代码
function pressEnter(HObj, event)
disp('hello')
import java.util.*;
import java.awt.;
import java.awt.AWTException;
import java.awt.Robot;
import java.awt.event.KeyEvent;
rob = Robot;
rob.keyPress(KeyEvent.VK_ENTER)
rob.keyRelease(KeyEvent.VK_ENTER)
end