autoside Posted April 1, 2019 Share Posted April 1, 2019 (edited) edit: resolved in a much easier way. I used "_WinAPI_GetKeyState" as a kind user suggested on this topic. It will immediately check the status of scroll, num, and caps lock. To revert the functions (so off instead of on) simply put "if not" in front of it. :old post edited post from my original question which was about using scroll lock status. I ended up using this which worked for my needs. $scrolllock = DllCall("user32.dll", "long", "GetKeyState", "long", 0x91) If NOT @error Then If $scrolllock[0] = 0 Then ElseIf $scrolllock[0] = 1 Then However, this code doesn't seem to work when compiled in 64 bit, only 32. Is there a way to use DLLs like this in 64 bit or no? The DLL called here exists in 64 bit, but its under the same name so I'm not sure if there's a way to call it instead. If no, is there another way I can remake this code? I like the lock keys because you get a light as an indicator Edited April 2, 2019 by autoside Link to comment Share on other sites More sharing options...
Nine Posted April 1, 2019 Share Posted April 1, 2019 Yes it is possible to do it. But I am not sure it is the right way to go. Can you please explain what kind of application you are trying to automate this way ? “They did not know it was impossible, so they did it” ― Mark Twain Spoiler Block all input without UAC Save/Retrieve Images to/from Text Monitor Management (VCP commands) Tool to search in text (au3) files Date Range Picker Virtual Desktop Manager Sudoku Game 2020 Overlapped Named Pipe IPC HotString 2.0 - Hot keys with string x64 Bitwise Operations Multi-keyboards HotKeySet Recursive Array Display Fast and simple WCD IPC Multiple Folders Selector Printer Manager GIF Animation (cached) Screen Scraping Multi-Threading Made Easy Link to comment Share on other sites More sharing options...
autoside Posted April 1, 2019 Author Share Posted April 1, 2019 (edited) 3 hours ago, Nine said: Yes it is possible to do it. But I am not sure it is the right way to go. Can you please explain what kind of application you are trying to automate this way ? Trying to create a custom mouse tool because the official software for it isn't very good. Lets me rebind my mouse keys and some other simple things. I particularly like the lock keys just because they give lights as indicators. Edited April 1, 2019 by autoside Link to comment Share on other sites More sharing options...
Nine Posted April 1, 2019 Share Posted April 1, 2019 Look at this function _WinAPI_GetKeyState ($VK_*). I just tested it in x86 and x64 and it is working fine... autoside 1 “They did not know it was impossible, so they did it” ― Mark Twain Spoiler Block all input without UAC Save/Retrieve Images to/from Text Monitor Management (VCP commands) Tool to search in text (au3) files Date Range Picker Virtual Desktop Manager Sudoku Game 2020 Overlapped Named Pipe IPC HotString 2.0 - Hot keys with string x64 Bitwise Operations Multi-keyboards HotKeySet Recursive Array Display Fast and simple WCD IPC Multiple Folders Selector Printer Manager GIF Animation (cached) Screen Scraping Multi-Threading Made Easy Link to comment Share on other sites More sharing options...
autoside Posted April 2, 2019 Author Share Posted April 2, 2019 (edited) Thank you! I was familiar with the sync version of that (where you hold a key down) but not that one (I'm still new). I didn't expect it to so easily check for the locks being on or off. Works perfectly! Appreciate it! Edited April 2, 2019 by autoside Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now