[webkit-dev] Detecting paste with cmd-v on Mac

Rush Manbert rush at manbert.com
Wed Mar 4 09:51:36 PST 2009

On Mar 3, 2009, at 11:21 PM, Alexey Proskuryakov wrote:

> 03.03.2009, в 23:21, Rush Manbert написал(а):
>> I checked the values of the DOM even modifiers alyKey, ctrlKey, and  
>> shiftKey and they are all false on a cmd-v paste
> That's expected, Cmd maps to metaKey.
>> Is the difference between Safari and WebKit expected?
> Yes, WebKit preserves legacy keyboard event behavior for  
> applications linked against old SDK, see <http://trac.webkit.org/browser/trunk/WebKit/mac/WebView/WebView.mm#L1284 
> >. The behavior was changed to be IE-compatible in version 3.1.
> I expect that checking for evt.metaKey will make it easy to filter  
> out Cmd+V.
> - WBR, Alexey Proskuryakov

Thank you. I had missed the fact that metaKey exists as an event  
property (and had wondered why there was nothing like that). Checking  
for it works perfectly.

Best regards,

More information about the webkit-dev mailing list