Quick fix for Window Ctrl charcter handling.

This is needed to allow platform compatibel e_text and e_length, but a lot more work ist needed to unify keyboard
handling
This commit is contained in:
Matthias Melcher 2024-08-23 12:43:21 +02:00
parent f151ecb87b
commit 1ae43956e2
2 changed files with 6 additions and 1 deletions

View File

@ -678,7 +678,12 @@ int Fl_Wayland_Screen_Driver::compose(int& del) {
// letter+modifier key
int condition = (Fl::e_state & (FL_ALT | FL_META | FL_CTRL)) && ascii < 128 ;
// pressing modifier key
// FL_Shift_L, FL_Shift_R, FL_Control_L, FL_Control_R, FL_Caps_Lock
// FL_Meta_L, FL_Meta_R, FL_Alt_L, FL_Alt_R
// TODO: FL_Alt_Gr
condition |= (Fl::e_keysym >= FL_Shift_L && Fl::e_keysym <= FL_Alt_R);
// FL_Home FL_Left FL_Up FL_Right FL_Down FL_Page_Up FL_Page_Down FL_End
// FL_Print FL_Insert FL_Menu FL_Help and more
condition |= (Fl::e_keysym >= FL_Home && Fl::e_keysym <= FL_Help);
condition |= Fl::e_keysym == FL_Tab;
//fprintf(stderr, "compose: condition=%d e_state=%x ascii=%d\n", condition, Fl::e_state, ascii);

View File

@ -332,7 +332,7 @@ void Fl_WinAPI_Screen_Driver::get_system_colors()
int Fl_WinAPI_Screen_Driver::compose(int &del) {
unsigned char ascii = (unsigned char)Fl::e_text[0];
int condition = (Fl::e_state & (FL_ALT | FL_META)) && !(ascii & 128) ;
int condition = (Fl::e_state & (FL_ALT | FL_META | FL_CTRL)) && !(ascii & 128) ;
if (condition) { // this stuff is to be treated as a function key
del = 0;
return 0;