But you're right, XwcLookupString() would be the better way since it can deal with dead keys (as much as XmbLookupString()). Find below the output of xev when pressing dead-´ and then e, which should be combined to é.
If you don't want to deal with wchar, you could use XmbLookupString() and handle the backspace and number-of-stars-to-display issues yourself by saving the number of bytes for each character somewhere.
--------------------
KeyPress event, serial 31, synthetic NO, window 0x4400001,
root 0xb0, subw 0x0, time 235600638, (16,71), root:(446,402),
state 0x10, keycode 21 (keysym 0xfe51, dead_acute), same_screen YES,
XLookupString gives 2 bytes: (c2 b4) "´"
XmbLookupString gives 0 bytes:
XFilterEvent returns: True
KeyPress event, serial 34, synthetic NO, window 0x4400001,
root 0xb0, subw 0x0, time 235606934, (16,71), root:(446,402),
state 0x10, keycode 26 (keysym 0x65, e), same_screen YES,
XLookupString gives 1 bytes: (65) "e"
XmbLookupString gives 1 bytes: (65) "e"
XFilterEvent returns: True
KeyPress event, serial 34, synthetic NO, window 0x4400001,
root 0xb0, subw 0x0, time 235606934, (16,71), root:(446,402),
state 0x10, keycode 0 (keysym 0xe9, eacute), same_screen YES,
XLookupString gives 0 bytes:
XmbLookupString gives 2 bytes: (c3 a9) "é"
XFilterEvent returns: False
But you're right, XwcLookupString() would be the better way since it can deal with dead keys (as much as XmbLookupString()). Find below the output of xev when pressing dead-´ and then e, which should be combined to é. of-stars- to-display issues yourself by saving the number of bytes for each character somewhere.
If you don't want to deal with wchar, you could use XmbLookupString() and handle the backspace and number-
------- ------- ------
KeyPress event, serial 31, synthetic NO, window 0x4400001,
root 0xb0, subw 0x0, time 235600638, (16,71), root:(446,402),
state 0x10, keycode 21 (keysym 0xfe51, dead_acute), same_screen YES,
XLookupString gives 2 bytes: (c2 b4) "´"
XmbLookupString gives 0 bytes:
XFilterEvent returns: True
KeyPress event, serial 34, synthetic NO, window 0x4400001,
root 0xb0, subw 0x0, time 235606934, (16,71), root:(446,402),
state 0x10, keycode 26 (keysym 0x65, e), same_screen YES,
XLookupString gives 1 bytes: (65) "e"
XmbLookupString gives 1 bytes: (65) "e"
XFilterEvent returns: True
KeyPress event, serial 34, synthetic NO, window 0x4400001,
root 0xb0, subw 0x0, time 235606934, (16,71), root:(446,402),
state 0x10, keycode 0 (keysym 0xe9, eacute), same_screen YES,
XLookupString gives 0 bytes:
XmbLookupString gives 2 bytes: (c3 a9) "é"
XFilterEvent returns: False