geekhack

geekhack Community => Keyboards => Topic started by: ibu on Fri, 08 January 2010, 04:45:06

Title: Mapping F17 as Windows Key
Post by: ibu on Fri, 08 January 2010, 04:45:06
My Cherry G80-5000 does not have a Windows Key.

But it has - at the left side - a column of the keys F13-F17.

In the docu of the keyboard it is said, that F17 emulates Shift+F7. That works.

I like to use F17 like a Windows Key.

My first try was a mapping with Autohotkey:
+F7::Send {Shift Up}{LWin}

But:
When I press F17 the startmenue appears. But it should not appear until you release the F17 key.
Because - of course - I want to use all standard key combinations like "WIN+E" or "WIN+R" etc.

At the moment that is not possible.

Do you know a solution?

Further I tried the following tools
MKLC
SharpKeys
RemapKeys

Without success. The do not show the F13-F17, nor do they offer a mapping on a combination like "SHIFT+F7".

Thanks for your help.

I'm looking forward to the Miniguru, which offers a nice mapping tool and a nice mapping saving technology: saving on the firmware.
Great.
Title: Mapping F17 as Windows Key
Post by: DreymaR on Fri, 08 January 2010, 06:13:03
How odd to not send the F17 code (the codes F13-F24 are implemented) instead of some jiggery pokery Shift+F7?! Be that as it may, here's a solution that ought to see you through:

Code: [Select]
+F7::Send {LWin Down}
+F7 Up::Send {Lwin Up}


If you find it necessary, send {Shift Up} like in your example as well.

What this won't do is let you use Shift+Win, Ctrl+Win and such combinations. Not sure if you need any. You could of course map, say Ctrl+Shift+F7 (!+F7) specifically to a modified LWin if you need to.

For the other keys you have there, maybe you could have fun sending some of these:

Code: [Select]
Browser_Back
Browser_Forward
Browser_Refresh
Browser_Stop
Browser_Search
Browser_Favorites
Browser_Home
Volume_Mute
Volume_Down
Volume_Up
Media_Next
Media_Prev
Media_Stop
Media_Play_Pause
Launch_Mail
Launch_Media
Launch_App1
Launch_App2
Title: Mapping F17 as Windows Key
Post by: ocdonkb on Fri, 08 January 2010, 13:15:20
I've been using KeyTweak (http://webpages.charter.net/krumsick/) for getting Windows key on older keyboards. Give that a try.
Title: Mapping F17 as Windows Key
Post by: ibu on Sat, 09 January 2010, 06:26:29
Quote from: DreymaR;149089

Code: [Select]
+F7::Send {LWin Down}
+F7 Up::Send {Lwin Up}
With that code pressing or pressing-releasing my F17 key has no effect at all.

With
Code: [Select]
+F7::Send {Shift Up}{LWin Down}
+F7 Up::Send {Shift Up}{Lwin Up}
I have the same effect as with the code in the first posting:

Combinations like "WIN+E" are impossible, because pressing F17 functions like pressing-releasing the Win key on a keyboard with win key.
Quote from: DreymaR;149089
What this won't do is let you use Shift+Win, Ctrl+Win and such combinations. Not sure if you need any. You could of course map, say Ctrl+Shift+F7 (!+F7) specifically to a modified LWin if you need to.
At the moment I do not need such combinations.

But I need combinations like
WIN (pressed and holded) and
arrow key left
arrow key right
Enter
Home
etc.

My goal is, that I do not have to manipulate or add something to a mapping file, when I decide to add a new hotkey of that type of combination (WIN plus non meta key (shift, ctrl).
Title: Mapping F17 as Windows Key
Post by: ibu on Sat, 09 January 2010, 06:41:19
Quote from: ocdonkb;149236
I've been using KeyTweak (http://webpages.charter.net/krumsick/) for getting Windows key on older keyboards. Give that a try.
I installed the tool.
First, I deactivated the Autohotkey entries.

Then I pressed F17 in the dialog "HalfTeachMode" of KeyTweak.
Result: Scancode 57435
I mapped it to "left Windows key".
Please see:
(http://geekhack.org/attachment.php?attachmentid=7199&stc=1&d=1263040929)

Effect when I press F17: none at all.

Quite complicated stuff that remapping :(

It looks like, that KeyTweak could not deal with the combination "SHIFT+F7" but only with single Keys like F7.

But I need to remap a "combination" to a single key.
Title: Mapping F17 as Windows Key
Post by: ibu on Mon, 11 January 2010, 01:46:07
Does really nobody has an another idea to solve the task?
Title: Mapping F17 as Windows Key
Post by: DreymaR on Mon, 11 January 2010, 03:29:39
My guess, then, is that your keyboard sends some lame-ass key combos instead of correctly emulating a key press.

Thus, releasing the F17 key doesn't send a key release as it should maybe?

However, could you try replacing the second line with:

*F7 Up:: Send {LWin Up}

On the other hand, if pressing and holding down the F17 key opens the Win menu before you release the key then the second line isn't the problem here.

'Scan code 54735' sounds like the scan code was reported in decimal which is highly unconventional and fills me with horror. In hex that's E0 5B which isn't the code for shift-F7 at all but ... *drum roll* ... the scan code for LWin!!! So now what, you remapped the key already (but it still isn't working right) and then remapped the LWin key to itself?! Better check out your registry or something by now.

If you want a clean remap section, run the following script by making it a .reg file and running that:
Code: [Select]
REGEDIT4

[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Keyboard Layout]
; The next line maps RWin <- CapsLock <- BackSpace
;&quot;Scancode Map&quot;=hex:00,00,00,00,00,00,00,00,03,00,00,00,0e,00,3a,00,3a,00,5c,e0,00,00,00,00
; The next line remaps only CapsLock <- BackSpace
;&quot;Scancode Map&quot;=hex:00,00,00,00,00,00,00,00,02,00,00,00,0e,00,3a,00,00,00,00,00
; The next line removes all scancode remappings
&quot;Scancode Map&quot;=-

[HKEY_CURRENT_USER\Keyboard Layout]
&quot;Scancode Map&quot;=-

; Numbers are LittleEndian (0x12345678 -> 78,56,34,12)
; ---------------------------------------------------------------------
; Bytes       Meaning
; ---------------------------------------------------------------------
; 00 00 00 00 Version info (usually zero)
; 00 00 00 00 Flags (usually zero)
; 03 00 00 00 # of entries (# of mappings +1 for the terminator)
; 0e 00 3a 00 The CapsLock(3a) key now sends a BackSpace(0e) scancode
; 3a 00 5c e0 The RWin(e05c)   key now sends a CapsLock(3a)  scancode
; 00 00 00 00 Null terminator (always zero)


I suppose that KeyTweak can clean things up too.

Better yet, run regedit and browse to the keys mentioned in the script (both the LM and CU ones!) to see what's there before you change anything.
Title: Mapping F17 as Windows Key
Post by: sixty on Mon, 11 January 2010, 08:34:24
Some keyboards indeed send Shift+F1-10 instead of F11-F20. The Boscom/Unicomp Terminal emulator keyboard does this too. I also tried remapping it to single keys without much success. Since the keyboard indeed sends Shift+F7 you will not be able to remap it based on scancodes with KeyTweak and so on.

IF its possible to begin with, then probably only with Autohotkey. One problem I see here (logically speaking) is that when the keyboard sends Shift+F7 and you remap that combination to send + of your choice, would that in the end generate ++ or possibly even +++ since your shift modifier is sent on hardware level?