onKeyPressed vs OnKey

I'm trying to utilise the ENTER key to recognise 2 different types of input based on whether the user HOLDS the physical key for a longer time vs a single press.

I tried onKeyPressed(), which works, but it also triggers onKEY() at the same time..

is this expected behaviour or am I supposed to do something in the background by putting a timer and making sure the user presses the key for x seconds before triggering a flag or call a callback method?

onKeyPressed keynum:0
onkey :4
onKeyPressed keynum:0
onkey :4


function onKeyPressed(evt) {
var keynum = Lang.format("$1$", [evt.getType()]);
Sys.println("onKeyPressed keynum:" + keynum);
return true;
}


function onKey(evt) {
var keynum = Lang.format("$1$", [evt.getKey()]);
Sys.println("OnKey :" + keynum);
}