Jump to content

davornik

Members
  • Content Count

    33
  • Joined

  • Last visited

Everything posted by davornik

  1. davornik

    Intercept keys from hardware keyboard (HID Device)

    I would like to intercept Key from external keyboard before it reaches TEdit or Form. Is this possible?
  2. davornik

    Intercept keys from hardware keyboard (HID Device)

    That is not good solution, has some issues. However, OnFormKeyUp is better choice (key is possible to receive only once according to Android docs), but if TEdit is focused TForm doesn't get key. Then, again, if I type Key in external keyboard and I am in TEdit control, key is shown in TEdit (I would like to Intercept it before it reaches any Control on Form or Form itself). Is it possible to differentiate Key origin? Is it received from Virtual Keyboard or HID device?
  3. Perhaps you can use this thread: https://en.delphipraxis.net/topic/5883-delphi-1042-ce-support-android-api-30/
  4. davornik

    Delphi 10.4.2 CE support Android API 30

    Thank you for yours post, this also helped me to upload app to Google store. Just to make things clearer to download android-30 you must: - run cmd.exe - type cd [path] to go to location where sdkmanager.bat is (usually it is: C:\Users\Public\Documents\Embarcadero\Studio\21.0\PlatformSDKs\android-sdk-windows\tools\bin or C:\Users\Public\Documents\Embarcadero\Studio\21.0\CatalogRepository\AndroidSDK-2525-21.0.40680.4203\tools\bin) - type sdkmanager "platforms;android-30" - answer y on question, and wait until it says "done" Everything else is straightforward...
  5. davornik

    Unit uDGVMUtils and 64 bit...

    Code can be made compatible with 64-bit, i have posted probable solution here: https://stackoverflow.com/a/61874765/3225668 NOTE: in FastcodeCPUID.pas there is an error with position of registers when returning value. Registers in code goes like Move...EBX...EDX...ECX... Proper way should be EBX...ECX...EDX...!
  6. // VMware detection as described by Elias Bachaalany function IsInsideVMware: Boolean; //------------------------------ procedure ChkVMware; asm push edx; push ecx; push ebx; mov eax, 'VMXh'; mov ebx, 0; mov ecx, 10; mov edx, 'VX'; in eax, dx; cmp ebx, 'VMXh'; setz [Result]; pop ebx; pop ecx; pop edx; end; //------------------------------ begin Result := True; try ChkVMware; except Result := False; end; end; function IsRunningUnderHyperV: BOOL; stdcall; var VMBranding: array[0..12] of AnsiChar; //------------------------------ procedure GetVMBrand; asm mov eax, $40000000; cpuid; mov dword ptr [VMBranding+0], ebx; // Get the VM branding string mov dword ptr [VMBranding+4], ecx; mov dword ptr [VMBranding+8], edx; end; //------------------------------ begin GetVMBrand; VMBranding[12] := #0; Result := CompareText(String(VMBranding), 'Microsoft Hv') = 0; end; How can thiese function be done in 64-bit? On compile I get [dcc64 Error] Unit1.pas(33): E2116 Invalid combination of opcode and operands Registers need to be changed. Which to use?
  7. davornik

    Detect virtual machine in 64bit?

    I have finally found solution and posted it here: https://stackoverflow.com/a/61874765/3225668
  8. davornik

    Detect virtual machine in 64bit?

    procedure ChkVMware; asm push rdx; push rcx; push rbx; mov rax, 'VMXh'; mov rbx, 0; mov rcx, 10; mov rdx, 'VX'; in rax, dx; <-- here is error: operand size mismatch cmp rbx, 'VMXh'; setz [Result]; pop rbx; pop rcx; pop rdx; end; Thank you. In that link registers are like eax, edx, ecx and rbx for 32-bit, but if you change them to 64-bit (rax, rdx, rcx, rbx) then I get error: operand size mismatch. I even dont know if this is proper way to change registers?
×