LPKit icon indicating copy to clipboard operation
LPKit copied to clipboard

LPMultiLineTextField consumes all key events

Open BlairDuncan opened this issue 14 years ago • 6 comments

Once a LPMultiLineTextField is activated, it continues to consume all key events even when not active.

From what I understand, the method "performKeyEquivalent" should by default return NO and only YES if the key was acted on.

Actually I'm not even sure if it needs to be there at all, I don't notice any difference with it completely removed.

BlairDuncan avatar Aug 25 '10 20:08 BlairDuncan

So, I believe this is there to not swallow events such as cmd+c.

This seems like a bug where it just doesn't resign first responder appropriately, and should be fixed elsewhere.

luddep avatar Sep 03 '10 17:09 luddep

Cappuccino will do the right thing, it took me an hour to figure out that LPMultiLineTextField was passing all events along to the browser. It's mere presence on the page royally screws key events everywhere with this method. This method is meant for assigning keyboard shortcuts to things like buttons.

appden avatar Oct 14 '10 19:10 appden

I can't reproduce those problems, but if anyone produces a fix I'll merge them in right away.

luddep avatar Oct 15 '10 12:10 luddep

If you have undo/redo in your menubar, the keyboard shortcuts will not work when LPMultiLineTextField (MLTF) is on the page because implementing performKeyEquivalent on MLTF and always returning YES is effectively saying that it will always handle any keyboard shortcuts on the page.

The fix is simply removing that method. :)

appden avatar Oct 15 '10 23:10 appden

I'm having the same issue. I put together a really simple app demonstrating the issue. I confirmed that removing performKeyEquivalent: fixes the issue.

http://dl.dropbox.com/u/40652/LPMultilineTextField-tabbing-problem/index.html

eventualbuddha avatar Nov 17 '10 21:11 eventualbuddha

Here's my pull request that fixes it: https://github.com/luddep/LPKit/pull/35

eventualbuddha avatar Nov 17 '10 22:11 eventualbuddha