AGB  ·  Datenschutz  ·  Impressum  







Anmelden
Nützliche Links
Registrieren
Zurück Delphi-PRAXiS Programmierung allgemein Win32/Win64 API (native code) Delphi Status der CAPS-Lock-Taste herausfinden ?
Thema durchsuchen
Ansicht
Themen-Optionen

Status der CAPS-Lock-Taste herausfinden ?

Ein Thema von DerAndereMicha · begonnen am 26. Jul 2005 · letzter Beitrag vom 26. Jul 2005
Antwort Antwort
Benutzerbild von DerAndereMicha
DerAndereMicha

Registriert seit: 1. Jul 2004
Ort: Berlin
208 Beiträge
 
Delphi 2007 Enterprise
 
#1

Status der CAPS-Lock-Taste herausfinden ?

  Alt 26. Jul 2005, 09:39
Hallo Zusammen,

kann mir von Euch evtl. jemand sagen, wie ich den aktuellen Status der CAPS-Lock-Taste herausfinden kann?

Mit if Key = VK_CAPITAL then sehe ich ja nur ob jemand die Taste gerade drückt, aber nicht ob sie aktiviert ist oder nicht...

Gruß Micha
Der Weg ist das Ziel...
  Mit Zitat antworten Zitat
barf00s
(Gast)

n/a Beiträge
 
#2

Re: Status der CAPS-Lock-Taste herausfinden ?

  Alt 26. Jul 2005, 09:41
GetAsyncKeyState()
  Mit Zitat antworten Zitat
Robert Marquardt
(Gast)

n/a Beiträge
 
#3

Re: Status der CAPS-Lock-Taste herausfinden ?

  Alt 26. Jul 2005, 09:44
GetKeyState(VK_CAPITAL)

Auszug aus dem Platform SDK:
Zitat:
GetKeyState Function

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

The GetKeyState function retrieves the status of the specified virtual key. The status specifies whether the key is up, down, or toggled (on, off—alternating each time the key is pressed).

Syntax

SHORT GetKeyState(int nVirtKey);

Parameters

nVirtKey
[in] Specifies a virtual key. If the desired virtual key is a letter or digit (A through Z, a through z, or 0 through 9), nVirtKey must be set to the ASCII value of that character. For other keys, it must be a virtual-key code.
If a non-English keyboard layout is used, virtual keys with values in the range ASCII A through Z and 0 through 9 are used to specify most of the character keys. For example, for the German keyboard layout, the virtual key of value ASCII O (0x4F) refers to the "o" key, whereas VK_OEM_1 refers to the "o with umlaut" key.

Return Value

The return value specifies the status of the specified virtual key, as follows:

If the high-order bit is 1, the key is down; otherwise, it is up.
If the low-order bit is 1, the key is toggled. A key, such as the CAPS LOCK key, is toggled if it is turned on. The key is off and untoggled if the low-order bit is 0. A toggle key's indicator light (if any) on the keyboard will be on when the key is toggled, and off when the key is untoggled.
  Mit Zitat antworten Zitat
Benutzerbild von DerAndereMicha
DerAndereMicha

Registriert seit: 1. Jul 2004
Ort: Berlin
208 Beiträge
 
Delphi 2007 Enterprise
 
#4

Re: Status der CAPS-Lock-Taste herausfinden ?

  Alt 26. Jul 2005, 09:53
Da bekommen ich doch aber auch nur raus ob die Taste gerade gedrückt gehalten wird
und nicht ob die Umschalt-Taste auf "Großbuchstaben" geschalten ist, oder ?
Der Weg ist das Ziel...
  Mit Zitat antworten Zitat
Benutzerbild von DerAndereMicha
DerAndereMicha

Registriert seit: 1. Jul 2004
Ort: Berlin
208 Beiträge
 
Delphi 2007 Enterprise
 
#5

Re: Status der CAPS-Lock-Taste herausfinden ?

  Alt 26. Jul 2005, 10:16
Habs rausgefunden.

Zitat:
If the low-order bit is 1, the key is toggled.
war des Rätsels Lösung.


 if (GetKeyState(VK_CAPITAL) AND 1) = 1 then und es klappt.


Danke


Gruß Micha
Der Weg ist das Ziel...
  Mit Zitat antworten Zitat
Antwort Antwort


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 22:24 Uhr.
Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024 by Thomas Breitkreuz