Recent

Author Topic: ddebian 12 input err!  (Read 3115 times)

d99net

  • New Member
  • *
  • Posts: 34
Re: ddebian 12 input err!
« Reply #15 on: May 01, 2024, 08:36:48 am »
cinnamon

Linux debian 6.1.0-20-amd64 #1 SMP PREEMPT_DYNAMIC Debian 6.1.85-1 (2024-04-11) x86_64 GNU/Linux


d99net

  • New Member
  • *
  • Posts: 34
Re: ddebian 12 input err!
« Reply #16 on: May 01, 2024, 08:54:58 am »
--------------------------
Edit1KeyDown
Edit1KeyPress
Edit1KeyUp
--------------------------
Edit1KeyDown
Edit1KeyPress
Edit1KeyUp
--------------------------
Edit1KeyDown
Edit1KeyPress
Edit1KeyUp

d99net

  • New Member
  • *
  • Posts: 34
Re: ddebian 12 input err!
« Reply #17 on: May 01, 2024, 02:04:44 pm »
procedure TForm1.Edit1KeyDown(Sender: TObject; var Key: Word; Shift: TShiftState
  );

begin
  writeln('--------------------------');
  writeln('Edit1KeyDown');
end;

procedure TForm1.Edit1KeyPress(Sender: TObject; var Key: char);
begin
  writeln('Edit1KeyPress');
 // Key := #0;
end;

procedure TForm1.Edit1KeyUp(Sender: TObject; var Key: Word; Shift: TShiftState);
begin
   writeln('Edit1KeyUp');
end;


=================================================================
gtk2callback.inc
=================================================================


function GTKKeyPress(Widget: PGtkWidget; Event: pgdkeventkey;
  Data: gPointer): GBoolean; cdecl;
begin
  debugln(['[GTKKeyPress]', 'Widget:', hexstr(Widget), ' Event:',
    hexstr(Event), '|type:', Ord(Event^._type), '|time:', Event^.time,
    '|keyval:', Event^.keyval, '|state:', Event^.state, ' Data:', hexstr(Data)]);
  Result := HandleGtkKeyUpDown(Widget, Event, Data, True, True, 'key-press-event');
end;


#######################################
      debian12
#######################################

[GTKKeyPress]Widget:00000000024D4390 Event:0000000002624AD0|type:8|time:293618|keyval:49|state:16 Data:00007F8312BFF5D0
--------------------------
Edit1KeyDown
Edit1KeyPress
[GTKKeyPress]Widget:00000000025D9060 Event:0000000002624AD0|type:8|time:293618|keyval:49|state:16 Data:00007F8312BEB010
[GTKKeyPress]Widget:00000000024D4390 Event:0000000002624A60|type:8|time:293618|keyval:49|state:16 Data:00007F8312BFF5D0
[GTKKeyPress]Widget:00000000025D9060 Event:0000000002624A60|type:8|time:293618|keyval:49|state:16 Data:00007F8312BEB010
[GTKKeyPress]Widget:00000000024D4390 Event:0000000002635660|type:8|time:293618|keyval:49|state:16 Data:00007F8312BFF5D0
[GTKKeyPress]Widget:00000000025D9060 Event:0000000002635660|type:8|time:293618|keyval:49|state:16 Data:00007F8312BEB010
Edit1KeyUp



#######################################
      lubuntu
#######################################

[GTKKeyPress]Widget:0000000001C133A0 Event:0000000001EAB500|type:8|time:542247|keyval:49|state:33554432 Data:00007FF0355675D0
--------------------------
Edit1KeyDown
Edit1KeyPress
[GTKKeyPress]Widget:0000000001DB8070 Event:0000000001EAB500|type:8|time:542247|keyval:49|state:33554432 Data:00007FF035553010
Edit1KeyUp




d99net

  • New Member
  • *
  • Posts: 34
Re: ddebian 12 input err!
« Reply #18 on: May 01, 2024, 02:31:55 pm »
The installed system Windows+Linux
« Last Edit: May 01, 2024, 02:34:25 pm by d99net »


d99net

  • New Member
  • *
  • Posts: 34
Re: ddebian 12 input err!
« Reply #20 on: May 01, 2024, 04:28:44 pm »
Take a look at this, it may be helpful:
https://wiki.freepascal.org/Lazarus_FAQ#Typing_in_edit_fields_generate_duplicate_letters
https://forum.lazarus.freepascal.org/index.php/topic,39213.msg268286.html#msg268286

export GTK_IM_MODULE=gtk-im-context-simple
export QT_IM_MODULE=simple
export XMODIFIERS=@im=none

It's normal, thank you

d99net

  • New Member
  • *
  • Posts: 34
Re: ddebian 12 input err!
« Reply #21 on: May 01, 2024, 05:48:06 pm »
//----------------------------------------------------------------
//   gtk2callback.inc
//----------------------------------------------------------------

threadvar
  g_KeyPress_count: integer;
  g_KeyPress_keyval: integer; // Event^.keyval
  g_KeyPress_time: guint32; // Event^.time

function GTKKeyPress(Widget: PGtkWidget; Event: pgdkeventkey;
  Data: gPointer): GBoolean; cdecl;
begin
  if (g_KeyPress_time = Event^.time) and (g_KeyPress_keyval = Event^.keyval) then
  begin
    Inc(g_KeyPress_count);
    if g_KeyPress_count > 3 then
    begin
      Result := True;
      exit;
    end;
  end
  else
  begin
    g_KeyPress_count := 0;
    g_KeyPress_keyval := Event^.keyval;
    g_KeyPress_time := Event^.time;
  end;

  Result := HandleGtkKeyUpDown(Widget, Event, Data, True, True, 'key-press-event');
end;   


---------------------------------------------------------------------------------------------------------------


ubuntu,deepin,lubuntu,OpenSuse,debian12   test ok!

(Only tested in English char)


TRon

  • Hero Member
  • *****
  • Posts: 3136
Re: ddebian 12 input err!
« Reply #22 on: May 01, 2024, 07:15:52 pm »
Thank you @korba812
next step in my process was asking about input method configuration  :) )
All software is open source (as long as you can read assembler)

 

TinyPortal © 2005-2018