Jump to content




Recent Status Updates

  • Photo
      15 Nov
    duzamucha

    Hi, I am final year Interior Design Student from University of Huddersfield. I am currently working on my final major project which is going to be linked to coding. I was hoping that you could help me with my research. I have prepared a short survey, it would be a massive help if you could fill it in for me. It takes less than 2 minutes to complete, I promise. Here is the link: https://www.surveymonkey.com/s/73XLJKK Thank you so much in advance!

View All Updates

Developed by TechBiz Xccelerator
Photo
- - - - -

Detect If Mouse Buttons is Swapped

delphi mouse button swap swapped mouse button

  • Please log in to reply
No replies to this topic

#1 Luthfi

Luthfi

    CC Leader

  • Expert Member
  • PipPipPipPipPipPipPip
  • 1,320 posts
  • Programming Language:PHP, Delphi/Object Pascal, Pascal, Transact-SQL
  • Learning:C, Java, PHP

Posted 22 February 2013 - 01:28 AM

In Windows, users may swapped mouse button to make physical right button to be considered as left button, and vice versa. This feature is to support left-handled people. And if you need to detect this possibility (like after you detect a mouse button is pressed, like in this code snippet), you can use the following code.

 

uses
  ...
  , Windows
  ...
  ;

(* This function returns true if the mouse buttons are swapped *)
function IsMouseBtnSwapped: Boolean;
begin
  Result := GetSystemMetrics(SM_SWAPBUTTON) <> 0;
end;

Edited by LuthfiHakim, 22 February 2013 - 01:33 AM.

  • 0





Powered by binpress