Left shift key equivalent modifier mask in xib unarchiver (#259)

* Left shift key equivalent modifier mask in xib unarchiver

This is necessary to offset the 8 bit right shift that occurs in the initWithCoder: method in NSButtonCell

* Shift modifier mask in xib unarchiver
This commit is contained in:
williameveretteggplant 2024-04-19 10:58:00 -06:00 committed by GitHub
parent 192c121a9d
commit d1562a37cd
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -1395,7 +1395,7 @@ didStartElement: (NSString*)elementName
// Seems that Apple decided to omit this attribute IF certain default keys alone
// are applied. If this key is present WITH NO setting then the following is
// used for the modifier mask...
object = [NSNumber numberWithUnsignedInt: NSCommandKeyMask];
object = [NSNumber numberWithUnsignedInt: (NSCommandKeyMask << 8)];
}
}
else
@ -1437,6 +1437,8 @@ didStartElement: (NSString*)elementName
mask |= NSFunctionKeyMask;
}
//This mask is left shifted 8 bits when encoded. When this is used to initialize the element, the mask will be shifted back to the right by 8 bits.
mask = (mask << 8);
object = [NSNumber numberWithUnsignedInt: mask];
}