我有这段代码来处理来自浏览器的CTRL
+ V
,工作正常但是我需要像这样获取剪贴板数据:
Event.addNativePreviewHandler(new Event.NativePreviewHandler() {
@Override
public void onPreviewNativeEvent(Event.NativePreviewEvent event)
{
NativeEvent ne = event.getNativeEvent();
// When CTRL + V is pressed
if (event.getNativeEvent().getKeyCode() == 86 && // 'V'
event.getNativeEvent().getCtrlKey() == true) {
// need to get the clipboard data
}
}
});