Microsoft Office Keyboard Scroll Wheel

Post your working scripts, libraries and tools
pondermatic
Posts: 4
Joined: 03 Jun 2015, 16:07

Microsoft Office Keyboard Scroll Wheel

03 Jun 2015, 16:40

I've published a script that uses the AHKHID library to restore the use of the Microsoft Office Keyboard's scroll wheel in Windows 7 and Windows 8.
https://gist.github.com/pondermatic/224 ... 61d1aeaff7
pabristow

Re: Microsoft Office Keyboard Scroll Wheel

19 Dec 2015, 10:34

I've got the files ahkhid.ahk and keywheel.ahk and copied them into the folder containing 'my' autohotkey.ahk (C:\Users\Paul\Documents)

So they should be in the scope of 'my' autohotkey.ahk.

I've edit 'my' script to contain just

#NoEnv ; Recommended for performance and compatibility with future AutoHotkey releases.
#SingleInstance force
SendMode Input ; Recommended for new scripts due to its superior speed and reliability.
SetWorkingDir %A_ScriptDir% ; Ensures a consistent starting directory.
; --------------------------------------------------
; Lines that start with a ; semicolon are comments.
; Microsoft Office Keyboard RT9450:

#Include %A_ScriptDir%\AHKHID.ahk

#Include %A_ScriptDir%\keywheel.ahk

and right clicked on the H icon in the right hand of the taskbar ( Microsoft Office Keyboard RT9450 and Windows 10 of course),
and clicked on the run script icon.

It appears to run - no errors (unlike when I mistyped the filenames ;-)

But the left hand keyboard wheel doesn't do anything (but the mouse on does).

What am I doing wrong?

Thanks

Paul
pabristow
Posts: 3
Joined: 19 Dec 2015, 13:10

Re: Microsoft Office Keyboard Scroll Wheel

03 Jan 2016, 10:49

I didn't understand the required location of library files, so file not found.

Now I've put the

ahkhid.* files in C:\Program Files\AutoHotkey\lib
and keywheel.ahk in C:\Program Files\AutoHotkey
and created a link to keywheel.ahk that is on my desktop.

A double click on the desktop icon starts the keyboard wheel working as it used to.

Good - No - Brilliant! :bravo:

No more aching right hand from scrolling and pointing with one hand.

Thanks

Paul
arie bos

Re: Microsoft Office Keyboard Scroll Wheel

11 Jul 2016, 16:14

I have copied the

but where can I find the ahkhid library files?

Thank you,
Arie
pondermatic
Posts: 4
Joined: 03 Jun 2015, 16:07

Re: Microsoft Office Keyboard Scroll Wheel

15 Jul 2016, 16:27

The AHKHID.ahk file is available from https://github.com/jleb/AHKHID.
ahha

Re: Microsoft Office Keyboard Scroll Wheel

27 Aug 2016, 08:44

pabristow

Thanks - awesome! :dance:
I love my RT9450 and the scroll wheel.
In the past I reassigned the left Cut button (from the Cut Copy Paste group) to Save as I use that more than Cut.
I looked at the code and see the table listing the Cut and Save values but do not see how to change the Cut button value to a Save a save button value, as the code values are just comments.
Any hint where to start appreciated.
pondermatic
Posts: 4
Joined: 03 Jun 2015, 16:07

Re: Microsoft Office Keyboard Scroll Wheel

27 Aug 2016, 10:58

Hi ahha,

Each column in the table is a byte number. The cut button sends hex 40 in byte 3. To reassign it to save, add the following code at line 131:

Code: Select all

    if (b3 = 0x40) {
        Send ^s
    }
Mikeinnc
Posts: 4
Joined: 23 Feb 2017, 23:42
Location: Perth, Western Australia

Re: Microsoft Office Keyboard Scroll Wheel

24 Feb 2017, 00:02

I've just resurrected an old Office Keyboard, and found these excellent scripts which all work wonderfully! Thanks to everyone involved. However, I'd like to make a change of program that gets launched when I press the 'Calendar' button. It's currently Outlook, but I don't use that for home use. I've looked at the code, and can see that the Calendar button has 0x80 in byte 1, and I - somewhat naively! - assumed if I followed the instruction in the previous post, I could make a change. So, as a first step, I added at line 125:

Code: Select all

if (b1 = 0x80) {
		Send (
	}
Well, it sure adds a ) to an open Notepad file, but Outlook still opens! Any tips or hints as to what I can / should do would be gratefully received. :)
Zeit_Helper
Posts: 1
Joined: 12 Jan 2018, 03:01

Re: Microsoft Office Keyboard Scroll Wheel

12 Jan 2018, 07:27

IMPORTANT!!!

I have just successfully configured my office keyboard and yes, I am absolutely delighted that the scroll wheel works well.

THE FILES UPLOADED ONTO GITHUB ARE "ODD" - they appear to have been modified strangely - could be hacked/backdoor stuff - the previews shown on GitHub are not what is contained in the files! Check for yourself...


Here is what I did step by step:

1. Installed Autohotkey (admin permissions required)
2. Created a subfolder called "lib" in "C:\Program Files\AutoHotkey"
3. Created a text.txt file in the lib subfolder, opened to edit it. Clicked on the AHKHID.ahk file at https://github.com/jleb/AHKHID which opens onto a page showing a 'preview' of the code supposedly contained within this file and copied all the text. (the file doesn't actually contain the preview code - its something else entirely). Pasted that preview txt into my opened text.txt and closed it and renamed it to 'AHKHID.ahk'
4. Created a new text.txt in "C:\Program Files\AutoHotkey" and copied in the preview text from KeyWheel.ahk at https://gist.github.com/pondermatic/224 ... 61d1aeaff7, closed and renamed it to KeyWheel.ahk.
5. The result is you will have clean files as follows: AHKHID.ahk in "C:\Program Files\AutoHotkey\lib" and KeyWheel.ahk in "C:\Program Files\AutoHotkey".
6. Double-click the KeyWheel.ahk file, to load it into Autohotkey. Test your office keyboard scroll wheel etc. Worked great for me.
7. If you want this autoloaded when windows starts then place Autohotkey program and this file in your startup files....Run....open: shell:startup.

So pleased after years of trying to get this keyboard working again.... huge thanks to podermatic (https://github.com/pondermatic)!
gregster
Posts: 5837
Joined: 30 Sep 2013, 06:48

Re: Microsoft Office Keyboard Scroll Wheel

12 Jan 2018, 14:16

Zeit_Helper wrote:THE FILES UPLOADED ONTO GITHUB ARE "ODD" - they appear to have been modified strangely - could be hacked/backdoor stuff - the previews shown on GitHub are not what is contained in the files! Check for yourself...
I don't think so. The files in zip file from Github are the same like you get from the preview. Only different thing about them is that they only have 'Linefeeds' at the end of each line, instead of carriage return+linefeed, so that depending on your editor (for example, if you use standard "Notepad" - Scite4AHK on the other hand, won't have a problem with it), you don't see/get nice line breaks. The Github preview mode will add the carriage returns for displaying, so if you copy that, you obviously get a format that is preferable (and the "standard") for MS Windows.

I think that has to do with github settings. Btw, some editors - like Scite4AHK - will replace the LFs with CRLFs on first saving of these files.
mpd671

Re: Microsoft Office Keyboard Scroll Wheel

05 Feb 2018, 13:56

I have my scroll wheel working, but the buttons aren't doing anything. Ideas, please?
mpd671
Posts: 3
Joined: 05 Feb 2018, 13:57

Re: Microsoft Office Keyboard Scroll Wheel

05 Feb 2018, 14:09

My wheel works, but the buttons don't do anything. Any suggestions?


Oops, Never mind... I had a cordless keyboard installed also. Soon as I removed the USB receiver I was back in business.

Thanks, folks.
Last edited by mpd671 on 05 Feb 2018, 14:28, edited 1 time in total.
pondermatic
Posts: 4
Joined: 03 Jun 2015, 16:07

Re: Microsoft Office Keyboard Scroll Wheel

05 Feb 2018, 14:16

mpd671, I had to try selecting different keyboards in the Microsoft Mouse and Keyboard Center until the extra buttons did what I wanted. If that doesn't work for you, you might be able to use AutoHotkey to detect the button codes and launch the apps.
mpd671
Posts: 3
Joined: 05 Feb 2018, 13:57

Re: Microsoft Office Keyboard Scroll Wheel

05 Feb 2018, 14:30

Thank you, but the dope factor was at play - I had a cordless keyboard installed as well. Thanks for your hard work!
mpd671
Posts: 3
Joined: 05 Feb 2018, 13:57

Re: Microsoft Office Keyboard Scroll Wheel

05 Feb 2018, 14:30

Thank you, but the dope factor was at play - I had a cordless keyboard installed as well. Thanks for your hard work!
snorbans
Posts: 1
Joined: 28 Sep 2019, 04:03

Re: Microsoft Office Keyboard Scroll Wheel

28 Sep 2019, 04:45

Having just done this myself, here is a full description of what's needed as to get the RT9450 keyboard buttons working, as I think there are a few things missing from the comments so far in this thread:
  1. First, download and install Microsoft Mouse & Keyboard Center : https://www.microsoft.com/accessories/en-us/downloads/mouse-keyboard-center
    The install program will say that your keyboard is not detected, but despite this it will activate most of the special buttons on your keyboard (not including the scroll wheel)
  2. Download and install AHK if you haven't already : https://www.autohotkey.com/download/
  3. Download pondermatic's KeyWheel.ahk script : (see 1st post for link)
    Either use the download zip option or click the "Raw" button then save the next page as "KeyWheel.ahk"
    You can put this anywhere you want, but probably best to put it with your other personal files (e.g. maybe in a directory under My Documents called "/configs/ahk/"rather than in the AHK install directory as suggested above
  4. Download the AHKHID.ahk script from : https://github.com/jleb/AHKHID
    Again, either use the download zip option or click the "Raw" button then save the next page as "KeyWheel.ahk"
    The key here is to create a NEW directory in the directory where you put "KeyWheel.ahk", call it "lib" and put the "AHKHID.ahk" script there
  5. To run: double click the "KeyWheel.ahk" file in explorer.
  6. To load automatically with Windows:
    1. open a run dialog (e.g. in Win 10 taskbar search field type run)
    2. type: shell:startup
    3. put a shortcut to your KeyWheel.ahk script in the folder that is opened in Explorer
  7. If you want to adjust what the buttons on your keyboard do:
    1. edit the KeyWheel.ahk script in notepad or right-click the icon in system tray and edit script
    2. adjust / add to the code in lines 125-140, as follows:
      1. look at the table specified at the top of the script. Each "b"x variable in lines 125-140 refers to which "x" byte is being sent when you press a certain button.
      2. add / adjust if expressions to tell AHK to do different things according to the value you expect to get in the right byte when you press a certain button.
      3. so, if you want to change the "cut" button to "Save As" (which is Ctrl+s shortcut in Windows):
        - you can see from the table that the cut button sends a value of 0x40 on byte b3 (ignore the 0x01 on byte b0)
        - add new 'if' expression (preferably just below where b3 is set up, so below line 121 in original script), saying:
        if(b3 = 0x40){
        Send ^s
        return ;so that the usual command is not executed
        }
      4. if you want to change any of the Application buttons to open a different program:
        - DON'T adjust the script. Easiest way is to re-assign your default mail program in Windows:
        - type "default" in windows search field, and choose default apps
        - reassign the default app you want to use
      5. if you want to do something more complicated, you may need to disable the automatic functions that the buttons execute in MS Mouse and Keyboard Center, as the "return" command might not work for other some buttons and so the original command is still executed.
        There ways of doing this, but, WARNING: this is potentially dangerous, don't bother unless you know what you're doing (and so full description below not included on purpose!). Possibilities include:
        -adding/adjusting values in the default mapping file for MS Mouse and Keyboard center which is here: C:\Program Files\Microsoft Mouse and Keyboard Center\ITypeDevices.xml
        -adding/adjusting values in the registry for the default keyboard, which is here: Computer\HKEY_CURRENT_USER\Software\Microsoft\IntelliType Pro\ModelSpecific\7003 (under EventMapping folder)
If there are still any other users of this old keyboard out there, hopefully this will help.
lambretta76
Posts: 1
Joined: 19 Feb 2021, 11:52

Re: Microsoft Office Keyboard Scroll Wheel

19 Feb 2021, 11:54

@snorbans

OMG Thank you so much. The Office Keyboard has been my favorite for nearly 20 years and I haven't had scroll wheel functionality for years. Finally updated to Windows 10 and found your instructions above, which worked like a champ. THANK YOU!

Return to “Scripts and Functions”

Who is online

Users browsing this forum: Google [Bot] and 26 guests