NSTextFieldMBS Question

I am using NSTextFieldMBS with NSPopoverMBS (nsviewMBS/nsviewcontrollerMBS) and I can’t seem to catch when the enter key is pressed. I am trying to process the me.Stringvalue when someone presses ‘return’.

I am trying to catch this in the the TextDidChange event for NSTextFieldMBS. What am I missing?

Thanks again in advance :slight_smile:

well if it is based on NSTextfield (which I assume it is)
there should be a delegate

  • ShouldEndEditing
  • ShouldReturn
  • shouldChangeTextIn (similar to KeyDown)

I had to use “CustomNSTextFieldMBS” as the super as those aren’t implemented for the nstextfieldMBS super I am finding. I know have keyup/keydown etc unlike the “nstextfieldMBS” implementation.

Thanks Dave.

KeyUp (e as NsEventMBS) as Boolean

// All keys fire and I work my me.stringvalue as the user input

// User is Done and presses return key
f e.keycode = 36 Then
  // Keycode 36 is the return key pressed -- in this case I close my NSPopover as I am finished editing
end if

I would expect Action event to fire!?

Action did fire, but without any passed arguments I couldn’t find how to capture the keycode as I could with keyup(e as NsEventMBS)

And currentEvent in NSApplicationMBS shows it?

I did not add that event. Will do and try that also.