which unit is the getkeystate function in? lazarus / 33-macOS - Mac OS X ---------------------------------------------------------------------- nds · 2020-01-24 07:38 under maсos please - in windows and so it works lack of full help system is the main disadvantage of lazarus ---------------------------------------------------------------------- PascalDragon · 2020-01-24 08:04 GetKeyState is a Windows only function. Neither Lazarus nor FPC provide documentation for the API provided by the platform as that is handled by the OS providers (Microsoft with MSDN, Apple documentation, POSIX, etc.). If you can't make use of existing cross platform functionality for your use case you'll need to research this for each platform separately. If you explain your needs the users here on the forum can likely help you find the right solution. ---------------------------------------------------------------------- howardpc · 2020-01-24 08:15 If you includeCode: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i uses LCLIntf;you get a widgetset implementation of GetKeyState. I don't know how well it is implemented for the Mac, but it works fine on Linuxes. ---------------------------------------------------------------------- nds · 2020-01-24 08:34 with Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i uses lclintf,lcltype; builds but dont work with any virtual key exclude vk_shift UPD: work in button.onclick and dont work in image.onclick PascalDragon you know any crossplatform method to get key state? ---------------------------------------------------------------------- Handoko · 2020-01-24 09:56 Quote from: PascalDragon on January 24, 2020, 09:04:57 amGetKeyState is a Windows only function. GetKeyState works on Linux too: https://forum.lazarus.freepascal.org/index.php/topic,42439.msg297949.h tml#msg297949 ---------------------------------------------------------------------- MarkMLl · 2020-01-24 10:34 Quote from: Handoko on January 24, 2020, 10:56:35 amQuote from: PascalDragon on January 24, 2020, 09:04:57 amGetKeyState is a Windows only function. GetKeyState works on Linux too: https://forum.lazarus.freepascal.org/index.php/topic,42439.msg297949.h tml#msg297949 It works but the results are somewhat platform-dependent. I was wrestling with shift keys a couple of weeks ago. https://forum.lazarus.freepascal.org/index.php/topic,48110.msg345932.h tml#msg345932 MarkMLl ---------------------------------------------------------------------- trev · 2020-01-24 11:37 For macOS, see the Wiki article: https://wiki.lazarus.freepascal.org/Cocoa_Internals/Input#Keyboard ---------------------------------------------------------------------- syntonica · 2020-01-27 07:05 Unfortunately, the paradigm Windows uses is the polar opposite of what Cocoa uses. With Windows, you just override one method with a case statement that parses the message sent. With Cocoa, you need to subclass NSView.  The value you seek is a member of the NSEvent that is sent to the appropriate handler, whether mouse or keyboard related. I haven't worked with the LCL yet, but the majority of this should be swept under the rug. I hope.