Ignore key character text input on 64 bit mac backend while Cmd is pressed, fixes 'c' and 'v' appearing in chat when copy/pasting. (Thanks Ally)

This commit is contained in:
UnknownShadow200 2020-06-24 11:22:41 +10:00
parent 730eadf47b
commit 6b4342d2c5
2 changed files with 8 additions and 2 deletions

View File

@ -2829,7 +2829,13 @@ static void ProcessKeyChars(id ev) {
const char* src;
String str;
id chars;
int i, len;
int i, len, flags;
/* Ignore text input while cmd is held down */
/* e.g. so Cmd + V to paste doesn't leave behind 'v' */
flags = (int)objc_msgSend(ev, selModifiers);
if (flags & 0x000008) return;
if (flags & 0x000010) return;
chars = objc_msgSend(ev, selCharacters);
src = objc_msgSend(chars, selUtf8String);