GTK2 does not have getKeyshiftstate() for FormDropFiles
Original Reporter info from Mantis: crlab @neurolabusc1
-
Reporter name: Chris Rorden
Original Reporter info from Mantis: crlab @neurolabusc1
- Reporter name: Chris Rorden
Description:
Dropping files from the explorer (nautilus, finder, etc) onto a program is a useful way to load files. It is often nice to detect if any keys are pressed (e.g. shift state) to provide special options. With Windows and Cocoa widgets, I can use getKeyshiftstate at the time an object is dropped. This does not work reliably for me using GTK2 and Ubuntu 18.04.
Steps to reproduce:
procedure TForm1.FormDropFiles(Sender: TObject; const FileNames: array of String);
//uses LCLIntf, LCLType;
var
K: Smallint;
ss: TShiftState;
begin
Label1.Caption := 'FileName: '+ Filenames[0];
ss := getKeyshiftstate;
if (ssMeta in ss) or (ssCtrl in ss) or (ssShift in ss) then
Label2.Caption := 'getKeyshiftstate detected'
else
Label2.Caption := 'getKeyshiftstate NOT detected';
if (GetKeyState(VK_SHIFT) And $80) <> 0 then
Label3.Caption := 'GetKeyState detected'
else
Label3.Caption := 'GetKeyState NOT detected';
K:= GetKeyState(VK_SHIFT);
Label4.Caption := 'GetKeyState = '+inttostr(K);
end;
Additional information:
Might be related to issue 33828
Mantis conversion info:
- Mantis ID: 34485
- OS: PopOS (Ubuntu)
- OS Build: 18.04
- Build: 59394
- Platform: System76 Oryx Pro
- Version: 2.1 (SVN)
- Monitored by: » @neurolabusc1 (Chris Rorden)