mirror of
https://github.com/panda3d/panda3d.git
synced 2025-09-30 08:44:19 -04:00
Fix crash when typing unicode characters above 7fff into text field
Can be reproduced when typing Shift+AltGr+5 into a DirectEntry on macOS.
This commit is contained in:
parent
63b1e44977
commit
95bffa8503
@ -41,7 +41,7 @@ ButtonEvent(ButtonHandle button, ButtonEvent::Type type, double time) :
|
||||
*
|
||||
*/
|
||||
INLINE ButtonEvent::
|
||||
ButtonEvent(short keycode, double time) :
|
||||
ButtonEvent(int keycode, double time) :
|
||||
_button(ButtonHandle::none()),
|
||||
_keycode(keycode),
|
||||
_highlight_start(0),
|
||||
|
@ -84,7 +84,7 @@ write_datagram(Datagram &dg) const {
|
||||
break;
|
||||
|
||||
case T_keystroke:
|
||||
dg.add_int16(_keycode);
|
||||
dg.add_uint16(_keycode);
|
||||
break;
|
||||
|
||||
case T_candidate:
|
||||
@ -119,7 +119,7 @@ read_datagram(DatagramIterator &scan) {
|
||||
break;
|
||||
|
||||
case T_keystroke:
|
||||
_keycode = scan.get_int16();
|
||||
_keycode = scan.get_uint16();
|
||||
break;
|
||||
|
||||
case T_candidate:
|
||||
|
@ -86,7 +86,7 @@ public:
|
||||
|
||||
INLINE ButtonEvent();
|
||||
INLINE ButtonEvent(ButtonHandle button, Type type, double time = ClockObject::get_global_clock()->get_frame_time());
|
||||
INLINE ButtonEvent(short keycode, double time = ClockObject::get_global_clock()->get_frame_time());
|
||||
INLINE ButtonEvent(int keycode, double time = ClockObject::get_global_clock()->get_frame_time());
|
||||
INLINE ButtonEvent(const wstring &candidate_string, size_t highlight_start,
|
||||
size_t highlight_end, size_t cursor_pos);
|
||||
INLINE ButtonEvent(const ButtonEvent ©);
|
||||
@ -109,7 +109,7 @@ public:
|
||||
|
||||
// _keycode will be filled in if type is T_keystroke. It will be the
|
||||
// Unicode character that was typed.
|
||||
short _keycode;
|
||||
int _keycode;
|
||||
|
||||
// _candidate_string will be filled in if type is T_candidate.
|
||||
wstring _candidate_string;
|
||||
|
@ -74,7 +74,7 @@ PUBLISHED:
|
||||
|
||||
public:
|
||||
ButtonHandle _button;
|
||||
short _keycode;
|
||||
int _keycode;
|
||||
wstring _candidate_string;
|
||||
size_t _highlight_start;
|
||||
size_t _highlight_end;
|
||||
|
Loading…
x
Reference in New Issue
Block a user