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