mirror of
https://github.com/ClassiCube/ClassiCube.git
synced 2025-09-16 19:15:14 -04:00
C client: Fix non-english keyboard input on linux
This commit is contained in:
parent
84be529f9e
commit
24c9bcc447
@ -494,15 +494,15 @@ void Window_ProcessEvents(void) {
|
||||
case KeyPress:
|
||||
{
|
||||
Window_ToggleKey(&e.xkey, true);
|
||||
UInt8 data[16]; UInt8 convBuffer[16];
|
||||
UInt8 data[16];
|
||||
int status = XLookupString(&e.xkey, data, Array_Elems(data), NULL, NULL);
|
||||
|
||||
/* TODO: Is this even right... */
|
||||
String conv = String_FromEmptyArray(convBuffer);
|
||||
String_DecodeUtf8(&conv, data, status);
|
||||
|
||||
Int32 i;
|
||||
for (i = 0; i < conv.length; i++) { Event_RaiseInt(&KeyEvents_Press, conv.buffer[i]); }
|
||||
/* TODO: Does this work for every non-english layout? works for latin keys (e.g. finnish) */
|
||||
UInt8 raw; Int32 i;
|
||||
for (i = 0; i < status; i++) {
|
||||
if (!Convert_TryUnicodeToCP437(data[i], &raw)) continue;
|
||||
Event_RaiseInt(&KeyEvents_Press, raw);
|
||||
}
|
||||
} break;
|
||||
|
||||
case KeyRelease:
|
||||
|
@ -880,7 +880,7 @@ ReturnCode Http_MakeRequest(struct AsyncRequest* request, void** handle) {
|
||||
/* https://stackoverflow.com/questions/25308488/c-wininet-custom-http-headers */
|
||||
if (request->Etag[0] || request->LastModified.Year) {
|
||||
headers = String_InitAndClearArray(headersBuffer);
|
||||
if (request->LastModified.Year > 0) {
|
||||
if (request->LastModified.Year) {
|
||||
String_AppendConst(&headers, "If-Modified-Since: ");
|
||||
DateTime_HttpDate(&request->LastModified, &headers);
|
||||
String_AppendConst(&headers, "\r\n");
|
||||
|
Loading…
x
Reference in New Issue
Block a user