You can handle with an event-Handler —> onKeyPress(()=>{ }=
This code belongs into the page-----onReady() code-section.
$w('#myTextfield').onKeyPress((event)=>{console.log("Key-Pressed")
if(pressedKey==="Enter"){console.log("ENTER pressed")
//DO SOMETHING ---> YOUR ACTIONS HERE
}
})