summaryrefslogtreecommitdiff
path: root/src/corelib/x11
diff options
context:
space:
mode:
authorgraemeg <graemeg@ae50a9b5-8222-0410-bf8d-8a13f76226bf>2008-03-01 18:37:40 +0000
committergraemeg <graemeg@ae50a9b5-8222-0410-bf8d-8a13f76226bf>2008-03-01 18:37:40 +0000
commitc8d74f5c2a1523409429ea72938d072f168d149d (patch)
tree5735da1e8ae2208196d483f27ab8c3ef1b673d12 /src/corelib/x11
parentfbf609017a99192cfc1f68077a9ba52d8c93204b (diff)
downloadfpGUI-c8d74f5c2a1523409429ea72938d072f168d149d.tar.xz
* Applied patch from Vladmir which enables Unicode text input under Linux.
Diffstat (limited to 'src/corelib/x11')
-rw-r--r--src/corelib/x11/gfx_x11.pas13
1 files changed, 10 insertions, 3 deletions
diff --git a/src/corelib/x11/gfx_x11.pas b/src/corelib/x11/gfx_x11.pas
index 3dea8c4f..55dfc995 100644
--- a/src/corelib/x11/gfx_x11.pas
+++ b/src/corelib/x11/gfx_x11.pas
@@ -566,7 +566,8 @@ end;
function TfpgApplicationImpl.StartComposing(const Event: TXEvent): TKeySym;
begin
SetLength(FComposeBuffer,
- XLookupString(@Event, @FComposeBuffer[1],
+ // XLookupString(@Event, @FComposeBuffer[1],
+ Xutf8LookupString(InputContext, @Event.xkey, @FComposeBuffer[1],
SizeOf(FComposeBuffer) - 1, @Result, @FComposeStatus));
end;
@@ -762,7 +763,8 @@ var
writeln('not a key event ');
end;
end;
- length := XLookupString(@event, @s[1], 9, @keysym, @compose_status);
+ // length := XLookupString(@event, @s[1], 9, @keysym, @compose_status);
+ length := Xutf8LookupString(InputContext, @event.xkey, @s[1], 9, @keysym, @compose_status);
SetLength(s, length);
if((length > 0) and (length <=9)) then
writeln('result of xlookupstring [' + s + ']');
@@ -846,10 +848,15 @@ begin
// Maybe in the future we can switch to XmbLookupString again.
if (ev.xkey.state and (ControlMask or Mod1Mask)) = 0 then
begin
- for i := 1 to Length(FComposeBuffer) do
+ {for i := 1 to Length(FComposeBuffer) do
begin
msgp.keyboard.keychar := FComposeBuffer[i];
fpgPostMessage(nil, w, FPGM_KEYCHAR, msgp);
+ end;}
+ for i := 1 to UTF8Length(FComposeBuffer) do
+ begin
+ msgp.keyboard.keychar := UTF8Copy(FComposeBuffer, i, 1);
+ fpgPostMessage(nil, w, FPGM_KEYCHAR, msgp);
end;
end;
end { if }