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

@ -48,7 +48,7 @@ void Bitmap_Scale(Bitmap* dst, Bitmap* src, int srcX, int srcY, int srcWidth, in
BitmapCol* srcRow; BitmapCol* srcRow;
int x, y, width, height; int x, y, width, height;
width = dst->Width; width = dst->Width;
height = dst->Height; height = dst->Height;
for (y = 0; y < height; y++) { for (y = 0; y < height; y++) {

View File

@ -2829,7 +2829,13 @@ static void ProcessKeyChars(id ev) {
const char* src; const char* src;
String str; String str;
id chars; 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); chars = objc_msgSend(ev, selCharacters);
src = objc_msgSend(chars, selUtf8String); src = objc_msgSend(chars, selUtf8String);