Hawkysoft Posted November 15, 2013 Share Posted November 15, 2013 Ok since I searched for the last hours to find a definitive answer. Is it possible to do a HotkeySet on a mousebutton? Preferable xButton1/xButton2 Also why isn't this just standard included in the hotkeyset as {xButton1} {xButton2} and would that be hard to include it? If there is no standard solution is there maybe a UDF which can do this? or maybe a dll call in a hotkeyset? Hope someone have some answers for me with regards, Hawkysoft Link to comment Share on other sites More sharing options...
l3ill Posted November 15, 2013 Share Posted November 15, 2013 (edited) Hi Hawkysoft, I assume you are referring to the additional function buttons on your mouse? I am not sure how you would use a HKS directly for this but you can set up your Mouse Buttons to Emulate say the F2 Key and tie the HKS to that key. Bill Edited November 15, 2013 by billo My Contributions... SnippetBrowser NewSciTE PathFinder Text File Manipulation FTP Connection Tester / INI File - Read, Write, Save & Load Example Link to comment Share on other sites More sharing options...
Hawkysoft Posted November 15, 2013 Author Share Posted November 15, 2013 Hi Hawkysoft, I assume you are referring to the additional function buttons on your mouse? I am not sure how you would use a HKS directly for this but you can set up your Mouse Buttons to Emulate say the F2 Key and tie the HKS to that key. Bill Hey billo, Thanks for your answer, that's basically my backup plan People adviced me not to use the _ispressed method, since that would be slower in performance. That's basically why I'm looking for a original/better function Just hope the dev's from autoit will implement it in HotKeySet ;/ Link to comment Share on other sites More sharing options...
BrewManNH Posted November 16, 2013 Share Posted November 16, 2013 Mouse buttons aren't keys, so you can't set them like keys, _IsPressed is what you need regardless of performance. Unless you want to start dealing with Windows messages (GUIRegisterMsg for a hint). If I posted any code, assume that code was written using the latest release version unless stated otherwise. Also, if it doesn't work on XP I can't help with that because I don't have access to XP, and I'm not going to.Give a programmer the correct code and he can do his work for a day. Teach a programmer to debug and he can do his work for a lifetime - by Chirag GudeHow to ask questions the smart way! I hereby grant any person the right to use any code I post, that I am the original author of, on the autoitscript.com forums, unless I've specifically stated otherwise in the code or the thread post. If you do use my code all I ask, as a courtesy, is to make note of where you got it from. Back up and restore Windows user files _Array.au3 - Modified array functions that include support for 2D arrays. - ColorChooser - An add-on for SciTE that pops up a color dialog so you can select and paste a color code into a script. - Customizable Splashscreen GUI w/Progress Bar - Create a custom "splash screen" GUI with a progress bar and custom label. - _FileGetProperty - Retrieve the properties of a file - SciTE Toolbar - A toolbar demo for use with the SciTE editor - GUIRegisterMsg demo - Demo script to show how to use the Windows messages to interact with controls and your GUI. - Latin Square password generator Link to comment Share on other sites More sharing options...
AutID Posted November 17, 2013 Share Posted November 17, 2013 Mouse buttons aren't keys, so you can't set them like keys, _IsPressed is what you need regardless of performance. Unless you want to start dealing with Windows messages (GUIRegisterMsg for a hint). Τhey actually are keys and you can set them as keys. You can register it's hex same as another key and then use hotkeyset function. It will work with the actual key and the set mouse key. https://iblockify.wordpress.com/ Link to comment Share on other sites More sharing options...
Hawkysoft Posted November 17, 2013 Author Share Posted November 17, 2013 (edited) Τhey actually are keys and you can set them as keys. You can register it's hex same as another key and then use hotkeyset function. It will work with the actual key and the set mouse key. than what is wrong with this? HotKeySet("05", "Test") While 1 Sleep(100) WEnd ;;;;;;;; Func Test() MsgBox(4096, "", "This is a message.") EndFunc tried "0x05" as well Edited November 17, 2013 by Hawkysoft Link to comment Share on other sites More sharing options...
AutID Posted November 17, 2013 Share Posted November 17, 2013 HotKeySet(0x05, "Test") While 1 Sleep(100) WEnd ;;;;;;;; Func Test() MsgBox(4096, "", "This is a message.") EndFunc https://iblockify.wordpress.com/ Link to comment Share on other sites More sharing options...
mikell Posted November 17, 2013 Share Posted November 17, 2013 Looks like you're confusing the _IsPressed and Send syntax Using your code HotKeySet(0x05, "Test") makes the msgbox appear on keypress '5' Link to comment Share on other sites More sharing options...
AutID Posted November 18, 2013 Share Posted November 18, 2013 (edited) Looks like you're confusing the _IsPressed and Send syntaxUsing your code HotKeySet(0x05, "Test") makes the msgbox appear on keypress '5'Read what i wrote in the previous post. I did it and it works for me Edited November 18, 2013 by AutID https://iblockify.wordpress.com/ Link to comment Share on other sites More sharing options...
Hawkysoft Posted November 18, 2013 Author Share Posted November 18, 2013 (edited) HotKeySet(0x05, "Test") While 1 Sleep(100) WEnd ;;;;;;;; Func Test() MsgBox(4096, "", "This is a message.") EndFunc Tried this at work, but seems to be not working either, it pops up on the number key, do i need to registrate the hex key first on a different way? Will test this also when im at home since thats a more reliable AI version Edited November 18, 2013 by Hawkysoft Link to comment Share on other sites More sharing options...
AutID Posted November 18, 2013 Share Posted November 18, 2013 What hotkeys do is set different keystrokes on different buttons of your keyboard. Which means you can press keystroke 9 and work as keystroke 5Try registering you mouse keystroke to an other one of the keyboard and then use HotKeySet to that button.You can even do it with your mouse button i think but i am not sure. I haven't test it yet. https://iblockify.wordpress.com/ Link to comment Share on other sites More sharing options...
water Posted November 18, 2013 Share Posted November 18, 2013 Searching the forum I found >this. And >this (works on MouseWheel) Or even better: >This What did you find when you searched the forum? My UDFs and Tutorials: Spoiler UDFs: Active Directory (NEW 2024-07-28 - Version 1.6.3.0) - Download - General Help & Support - Example Scripts - Wiki ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki Task Scheduler (2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki Standard UDFs: Excel - Example Scripts - Wiki Word - Wiki Tutorials: ADO - Wiki WebDriver - Wiki Link to comment Share on other sites More sharing options...
Hawkysoft Posted November 18, 2013 Author Share Posted November 18, 2013 Searching the forum I found >this. And >this (works on MouseWheel) Or even better: >This What did you find when you searched the forum? I only found something about guiregistermsg, however I'm not sure how to do this though ;/ Link to comment Share on other sites More sharing options...
water Posted November 18, 2013 Share Posted November 18, 2013 How about the threads I suggested? My UDFs and Tutorials: Spoiler UDFs: Active Directory (NEW 2024-07-28 - Version 1.6.3.0) - Download - General Help & Support - Example Scripts - Wiki ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki Task Scheduler (2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki Standard UDFs: Excel - Example Scripts - Wiki Word - Wiki Tutorials: ADO - Wiki WebDriver - Wiki Link to comment Share on other sites More sharing options...
BrewManNH Posted November 19, 2013 Share Posted November 19, 2013 Τhey actually are keys and you can set them as keys. You can register it's hex same as another key and then use hotkeyset function. It will work with the actual key and the set mouse key. You'd actually be wrong about that, your script doesn't work with the mouse, it only works when you press the number 5 key. HotKeySet(0x05, "Test") While 1 Sleep(100) WEnd ;;;;;;;; Func Test() MsgBox(4096, "", "This is a message.") EndFunc If I posted any code, assume that code was written using the latest release version unless stated otherwise. Also, if it doesn't work on XP I can't help with that because I don't have access to XP, and I'm not going to.Give a programmer the correct code and he can do his work for a day. Teach a programmer to debug and he can do his work for a lifetime - by Chirag GudeHow to ask questions the smart way! I hereby grant any person the right to use any code I post, that I am the original author of, on the autoitscript.com forums, unless I've specifically stated otherwise in the code or the thread post. If you do use my code all I ask, as a courtesy, is to make note of where you got it from. Back up and restore Windows user files _Array.au3 - Modified array functions that include support for 2D arrays. - ColorChooser - An add-on for SciTE that pops up a color dialog so you can select and paste a color code into a script. - Customizable Splashscreen GUI w/Progress Bar - Create a custom "splash screen" GUI with a progress bar and custom label. - _FileGetProperty - Retrieve the properties of a file - SciTE Toolbar - A toolbar demo for use with the SciTE editor - GUIRegisterMsg demo - Demo script to show how to use the Windows messages to interact with controls and your GUI. - Latin Square password generator Link to comment Share on other sites More sharing options...
AutID Posted November 19, 2013 Share Posted November 19, 2013 You'd actually be wrong about that, your script doesn't work with the mouse, it only works when you press the number 5 key.My script isn't what i wrote. It is an example. Registering the mouse button isn't in that small piece of code. I just copied the OP's example and removed the quotes on the HotKeySet function arround the hex. If you read carefully what i am saying then you may understand what i mean https://iblockify.wordpress.com/ Link to comment Share on other sites More sharing options...
Hawkysoft Posted November 19, 2013 Author Share Posted November 19, 2013 (edited) How about the threads I suggested? Hey, sorry for the late reply Well the hook.dll seems to be interesting however I cant find the exact hex code for the xbutton1 and xbutton2 like they done in the source script the. the mousewheel i've tried but didn't get it to work either with xbutton1/2 and the mouseonevent is more the thing that i try to avoid having a switch with cases (else would have used ispressed ) My script isn't what i wrote. It is an example. Registering the mouse button isn't in that small piece of code. I just copied the OP's example and removed the quotes on the HotKeySet function arround the hex. If you read carefully what i am saying then you may understand what i mean Than how to register the xbutton1/2 on the right method? I thought you had it working like this? Edited November 19, 2013 by Hawkysoft Link to comment Share on other sites More sharing options...
BrewManNH Posted November 20, 2013 Share Posted November 20, 2013 My script isn't what i wrote. It is an example. Registering the mouse button isn't in that small piece of code. I just copied the OP's example and removed the quotes on the HotKeySet function arround the hex. If you read carefully what i am saying then you may understand what i mean You posted it, so I assumed you'd tested it. Your script doesn't work as written, so why did you post it? I read what you wrote in this thread, and you've never explained EXACTLY how you're supposed to use HotKeySet with a mouse button. Frankly, I'm at a loss as to what it is you're saying as to how to do it, because you've given no information that's relevant. If I posted any code, assume that code was written using the latest release version unless stated otherwise. Also, if it doesn't work on XP I can't help with that because I don't have access to XP, and I'm not going to.Give a programmer the correct code and he can do his work for a day. Teach a programmer to debug and he can do his work for a lifetime - by Chirag GudeHow to ask questions the smart way! I hereby grant any person the right to use any code I post, that I am the original author of, on the autoitscript.com forums, unless I've specifically stated otherwise in the code or the thread post. If you do use my code all I ask, as a courtesy, is to make note of where you got it from. Back up and restore Windows user files _Array.au3 - Modified array functions that include support for 2D arrays. - ColorChooser - An add-on for SciTE that pops up a color dialog so you can select and paste a color code into a script. - Customizable Splashscreen GUI w/Progress Bar - Create a custom "splash screen" GUI with a progress bar and custom label. - _FileGetProperty - Retrieve the properties of a file - SciTE Toolbar - A toolbar demo for use with the SciTE editor - GUIRegisterMsg demo - Demo script to show how to use the Windows messages to interact with controls and your GUI. - Latin Square password generator Link to comment Share on other sites More sharing options...
AutID Posted November 20, 2013 Share Posted November 20, 2013 I know some things are difficult for some people to understand but as an mvp you should know that you can set your mouse buttons however you want via the mouse settings without even having to use autoit for that part. Then you can use hotkeyset function to the key you set your mouse. For example if you set your mouse button as keystroke 5 then hotkeyset with keystroke 5 would work. This is the easy way. Having a mouse with more than left, right and mouse wheel buttons means that you have probably a driver installed for the mouse with the setting running on the background. Chek them out. https://iblockify.wordpress.com/ Link to comment Share on other sites More sharing options...
Hawkysoft Posted November 20, 2013 Author Share Posted November 20, 2013 I know some things are difficult for some people to understand but as an mvp you should know that you can set your mouse buttons however you want via the mouse settings without even having to use autoit for that part. Then you can use hotkeyset function to the key you set your mouse. For example if you set your mouse button as keystroke 5 then hotkeyset with keystroke 5 would work. This is the easy way. Having a mouse with more than left, right and mouse wheel buttons means that you have probably a driver installed for the mouse with the setting running on the background. Chek them out. Thanks for your answer, but if I wanted to remap the mousekeys I wouldnt have to use the hex keys at all... but the point is I dont want to remap em every time.. So if anyone knows how to get this done without remapping of buttons on the mouse nor having ispressed methodes please let me know. Also if theres a dll out there to do this for xbutton1/2 im happy to hear about that as well 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