AGB  ·  Datenschutz  ·  Impressum  







Anmelden
Nützliche Links
Registrieren
Thema durchsuchen
Ansicht
Themen-Optionen

Key's funktionieren nicht

Ein Thema von EWeiss · begonnen am 5. Apr 2018 · letzter Beitrag vom 7. Apr 2018
 
EWeiss
(Gast)

n/a Beiträge
 
#8

AW: Key's funktionieren nicht

  Alt 6. Apr 2018, 11:57
WM_GETDLGCODE könnte dir dabei helfen. Damit kannst du Windows Bescheid sagen, dass du bestimmte Systemtasten selber behandeln möchtest.
Über die Accelerator table?
Wenn ja muss ich mal testen Danke.

@jaenicke Super Idee, das war's.
In meiner DLL!

Delphi-Quellcode:
    WM_GETDLGCODE:
      begin
        result := DLGC_WANTALLKEYS or DLGC_WANTARROWS;
        exit;
      end;
Und Auswertung in der Anwendung.
Ohne Hook oder der gleichen.

Delphi-Quellcode:
      WM_KEYDOWN:
        begin
          ObjectID := gSprCtrl.GI_GetObjectFocusID;
          if ObjectID > 0 then
          begin
            gSprCtrl.GD_GetObjectXY(ObjectID, x, y);
            x1 := x;
            y1 := y;

            if gSprCtrl.GI_IsCtrlKeyPressed then
            begin
              UseStep := 4;
              if gSprCtrl.GI_IsShiftKeyPressed then
                UseStep := 16;
            end else
              if gSprCtrl.GI_IsShiftKeyPressed then
                UseStep := 2
            else
            UseStep := 1;

            if gSprCtrl.GD_GetObjectScroll(ObjectID) then
            begin
              gSprCtrl.GI_GetBitmapSize(gSprCtrl.GI_GetBMP(WinHandle), Width, Height);
            end else
            begin
              GetClientRect(WinHandle, rc);
              Width := rc.Right;
              Height := rc.Bottom;
            end;
            gSprCtrl.GD_GetObjectBound(ObjectID, BoundWidth, BoundHeight);

            x2Div2 := BoundWidth div 2;
            y2Div2 := BoundHeight div 2;

            case wp of
              VK_HOME:
                x1 := 0;
              VK_END:
                x1 := MAX(Width - BoundWidth, 0);
              VK_PRIOR:
                y1 := 0;
              VK_NEXT:
                y1 := MAX(Height - BoundHeight, 0);
              VK_LEFT, VK_NUMPAD4:
                if x1 > -x2Div2 then
                  x1 := MAX(x1 - UseStep, -x2Div2);
              VK_UP, VK_NUMPAD8:
                if y1 > -y2Div2 then
                  y1 := MAX(y1 - UseStep, -y2Div2);
              VK_RIGHT, VK_NUMPAD6:
                if x1 < Width - x2Div2 then
                  x1 := MIN(x1 + UseStep, Width - x2Div2);
              VK_DOWN, VK_NUMPAD2:
                if y1 < Height - y2Div2 then
                  y1 := MIN(y1 + UseStep, Height - y2Div2);
            end;

            if (x <> x1) or (y <> y1) then
            begin
              x := x1;
              y := y1;
              gSprCtrl.GD_SetObjectXY(ObjectID, x1, y1, true);
            end;
            sMessage := 'Object ' + IntToStr(ObjectID) + ' coordinates ' + IntToStr(x) + ',' + IntToStr(y);
            ShowTip(true, sMessage);
          end;
        end;
Hat sich erledigt..

SHIFT + CONTROL + VK_DOWN geht nun ohne Probleme.
Das verschieben des Objects findet dann mit 16Facher Geschwindigkeit statt.

gruss

Geändert von EWeiss ( 6. Apr 2018 um 12:20 Uhr)
  Mit Zitat antworten Zitat
 


Forumregeln

Es ist dir nicht erlaubt, neue Themen zu verfassen.
Es ist dir nicht erlaubt, auf Beiträge zu antworten.
Es ist dir nicht erlaubt, Anhänge hochzuladen.
Es ist dir nicht erlaubt, deine Beiträge zu bearbeiten.

BB-Code ist an.
Smileys sind an.
[IMG] Code ist an.
HTML-Code ist aus.
Trackbacks are an
Pingbacks are an
Refbacks are aus

Gehe zu:

Impressum · AGB · Datenschutz · Nach oben
Alle Zeitangaben in WEZ +1. Es ist jetzt 11:02 Uhr.
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024-2025 by Thomas Breitkreuz