Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7500789
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T20:18:21+00:00 2026-05-29T20:18:21+00:00

I’d like to intercept or disable Cmd-Z/Shift-Cmd-Z during a text editing session for a

  • 0

I’d like to intercept or disable Cmd-Z/Shift-Cmd-Z during a text editing session for a table view cell.

It’s a cell-based table view with a series of columns whose values affect each other, such that filling in some columns will populate others automatically. When the user presses Cmd-Z in the middle of an editing session, the undo manager can change the property currently being edited, with confusing results for the user.

Here’s an example:

Step 1: User types “.030” in second column:

enter image description here

Step 2: User presses tab, model automatically updates columns three, four, and five:

enter image description here

Step 3: User presses Ctrl-Z, model undoes changes to columns two, three, four, and five, but editing session is still in progress, so old value shows in column three:

enter image description here

Step 4: Without typing anything, user presses tab which cancels editing, and value from column three disappears:

enter image description here

Nothing actually “wrong” is happening here, but it’s confusing.

When one of the cells is being edited, I just want to intercept Cmd-Z and Shift-Cmd-Z and ignore them. I think I should be overriding -keyDown: in whatever is first responder during that editing. But what is that? The table view doesn’t get those key events at all, and the cell isn’t a responder either.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-29T20:18:23+00:00Added an answer on May 29, 2026 at 8:18 pm

    Found a working solution. In my NSTableView subclass:

    // Disable undo and redo while table's field editors have first responder status
    -(BOOL)validateMenuItem:(NSMenuItem *)menuItem {
        if (self != self.window.firstResponder)
            if (@selector(undo:) == menuItem.action || @selector(redo:) == menuItem.action)
                return NO;
        return YES;
    }
    
    // Intercept undo events while table's field editors have first responder status
    -(IBAction)undo:(id)sender {
        if (self != self.window.firstResponder)
            [self noResponderFor:_cmd];
        else
            [self.nextResponder tryToPerform:@selector(undo:) with:sender];
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

For some reason, after submitting a string like this Jack’s Spindle from a text
I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
I would like to count the length of a string with PHP. The string
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I've got a string that has curly quotes in it. I'd like to replace
I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this
Configuring TinyMCE to allow for tags, based on a customer requirement. My config is
I have a text area in my form which accepts all possible characters from
I have an MVC Razor view @{ ViewBag.Title = Index; var c = (char)146;
I have a reasonable size flat file database of text documents mostly saved in

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.