Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8884865
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T21:10:04+00:00 2026-06-14T21:10:04+00:00

In VCL (Delphi 2010) I used this function to check whether control key is

  • 0

In VCL (Delphi 2010) I used this function to check whether control key is pressed:

function IsControlKeyPressed: Boolean;
begin
  Result := GetKeyState(VK_CONTROL) < 0;
end;

GetKeyState is function in windows library that I do not want to include it into my project.

How can I check if control or shift key is pressed in XE3 for firemonkey application?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-14T21:10:05+00:00Added an answer on June 14, 2026 at 9:10 pm

    If it helps for anyone else, this is my unit:

    unit uUtils;
    
    interface
    
    uses
    {$IFDEF MSWINDOWS}
      Winapi.Windows;
    {$ELSE}
      Macapi.AppKit;
    {$ENDIF}
    function IsControlKeyPressed: Boolean;
    function IsShiftKeyPressed: Boolean;
    
    implementation
    
    function IsControlKeyPressed: Boolean;
    begin
    {$IFDEF MSWINDOWS}
      Result := GetKeyState(VK_CONTROL) < 0;
    {$ELSE}
      Result := NSControlKeyMask and TNSEvent.OCClass.modifierFlags = NSControlKeyMask;
    {$ENDIF}
    end;
    
    function IsShiftKeyPressed: Boolean;
    begin
    {$IFDEF MSWINDOWS}
      Result := GetKeyState(VK_SHIFT) < 0;
    {$ELSE}
      Result := NSShiftKeyMask and TNSEvent.OCClass.modifierFlags = NSShiftKeyMask;
    {$ENDIF}
    end;
    
    end.
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Delphi 2010, Win32 VCL. I need to create a main menu for my application
I'm used to the Delphi VCL Framework, where TStreams throw exceptions on errors (e.g
Can I continue to use the interbase vcl components in delphi 2010 with firebird
Each Delphi's VCL source file has header like this: {*******************************************************} { } { CodeGear
in this article delphi.net(prism) support async file io. Delphi(Native/VCL) has Async File IO Class
Which mean I want to call function in delphi VCL/ DLL to retrieve information.
I've just compared the Delphi 2009 VCL/RTL code to the 2010 one. I noticed
I am using Delphi 2010 with only the stock standard VCL libraries. The target
I am using Delphi 2010 and if I create a new VCL application, drop
I have an (Delphi XE2) VCL app containing an object TDownloadUrl (VCL.ExtActns) to check

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.