full screen does not exit with escape key

Hi all,

I have added a menu item Enter Full Screen ⌃⌘ F to the view menu sending an action to the First Responder via its Received Actions. This automatically toggles to Exit Full Screen ⌃⌘ F and back without extra coding.

I could exit full screen by pressing the escape key or ⌃⌘ F.

As soon as I added a scroll view to a window and ran the app, the focus was in its text view and the escape key brought up a list of possible substitutions in the text view (but nothing ever happened if there was no text in there).

This stopped the full screen exit.
It still worked with ⌃⌘ F but not with the escape key.

I tested this by adding:

aWindow's makeFirstResponder_(missing value)

to the applicationWillFinishLaunching_ and confirmed that as soon as the focus is off the text view the escape key exits full screen.

I checked in Pages and even if the focus was on the text the escape key worked as documented to exit full screen

I then created an action for the the menu item connected to the Received Actions of the App Delegate but was not able to tell it to pass the message on:

on shiftFocusToWindow_(sender)
        aWindow's makeFirstResponder_(missing value)
        -- return current application's NSToggleFullScreen
        --return true
end shiftFocusToWindow_

Any ideas?

The escape key triggers the -complete: method of a text view. So you could possibly subclass the text view and override it. But the docs suggest: " You can change the key invoking this method using the text system’s key bindings mechanism; see ““Text System Defaults and Key Bindings”” for an explanation of the procedure."

thank you Shane,
i’ll look into it 2morrow morning
good night.