MATLAB: How to access the data of EventData

eventdata gui guide callbacks

I'm trying to detect the enter key when pressed, I already have my callback and I notice that eventdata displays me the next:
java.awt.event.KeyEvent[KEY_PRESSED,keyCode=68,keyText=D,keyChar='d'…
More data is display but for my purpose is irrelevant.
My question is, how can I access the keyCode, keyText or any of those values?
So I can do:
if keyCode == 10 %10 is the value of the key enter
%Do Stuff
end
Thanks!

Best Answer

I already found the solution.
To display all the available values that eventdata has, we do:
get(eventdata)
That will display all information, in my case, I want to detect the Enter Key, so we do:
check = get(eventdata,'KeyCode')
KeyCode return the ASCII code of the pressed key, for enter is 10d. So everything that is left is to do:
if check == 10
%do stuff
end
Cheers!