EskoFIN Posted February 12, 2021 Share Posted February 12, 2021 I have 2 keyboards. I want to launch macros etc. from the second keyboard. My script is otherwise complete but how can I prevent a key input from passing to the active application? For example, when I press "G" from the second keyboard and I have Notepad open, this character should not print to the screen. Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted February 12, 2021 Moderators Share Posted February 12, 2021 EskoFIN, This may give you an idea: M23 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area Link to comment Share on other sites More sharing options...
EskoFIN Posted February 12, 2021 Author Share Posted February 12, 2021 Thanks, my code is indeed based on that script. But if I understand correctly, that script only tells me which keyboard was used. The script does not block key presses. My problem is that I need to block all keys from the second keyboard so that those key presses will never get passed to the active application. How to block those keys, I have no idea. I found some forum threads like the one below: Apparently one user posted a code that worked but the code has been removed 😢 I'm wondering if it was a good idea to declare every key and key combination as autoit hotkey and then catch and inspect which keyboard was used. Probably not very nice solution though even if it worked! Any ideas? Link to comment Share on other sites More sharing options...
Nine Posted February 12, 2021 Share Posted February 12, 2021 Ok I have found a way. Not perfect because it executes on Key-up (lags a bit). There's a hint . But I am not sure I am allowed to give the code here (do not PM me). So, please clear this with the mod first. “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...
Nine Posted February 14, 2021 Share Posted February 14, 2021 I finally decided to make a clean UDF out of it : EskoFIN 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...
EskoFIN Posted February 21, 2021 Author Share Posted February 21, 2021 On 2/14/2021 at 11:00 PM, Nine said: I finally decided to make a clean UDF out of it : Thanks for your script! I have tested it during the week and the script is very nice! Though continuous key presses are not possible anymore (like you already said) and I have not yet figured out how to live without them. I'd especially need pagedown and pageup buttons so that I can use my Logitech R400 laser pointer as a remote controller in any software. 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