Fix delete key setting a control character in wmEvent::utf8_buf
The check for control characters didn't account for delete (127). This wasn't noticeable in most cases as delete is mapped to delete text. Pressing Shift-Delete would enter 127 control character in the text-editor, 3D text & Python console. This happened X11 & Wayland, I didn't check other platforms.
This commit is contained in:
@@ -5670,7 +5670,9 @@ void wm_event_add_ghostevent(wmWindowManager *wm, wmWindow *win, const int type,
|
||||
event.utf8_buf[0] = '\0';
|
||||
}
|
||||
else {
|
||||
if (event.utf8_buf[0] < 32 && event.utf8_buf[0] > 0) {
|
||||
/* Check for ASCII control characters.
|
||||
* Inline `iscntrl` because the users locale must not change behavior. */
|
||||
if ((event.utf8_buf[0] < 32 && event.utf8_buf[0] > 0) || (event.utf8_buf[0] == 127)) {
|
||||
event.utf8_buf[0] = '\0';
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user