topbanner_forum
  *

avatar image

Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
  • Thursday October 10, 2024, 9:38 pm
  • Proudly celebrating 15+ years online.
  • Donate now to become a lifetime supporting member of the site and get a non-expiring license key for all of our programs.
  • donate

Author Topic: Get keystroke value  (Read 12710 times)

HankFriedman

  • Supporting Member
  • Joined in 2006
  • **
  • Posts: 147
  • A computer nerd whose also a psychic & astrologer
    • View Profile
    • Welcome to Hank Friedman's Website
    • Read more about this member.
    • Donate to Member
Get keystroke value
« on: June 08, 2009, 05:40 PM »
First, I'd like to thank everyone at DonationCoder.com and all of its members for the incredible quality and value of this website and its forum members.

I purchased a Kinesis Freestyle keyboard and it has "driverless" special function keys, some of which I'd like to remap.

I found the great utility SharpKeys at: http://www.randyrant...7/sharpkeys_211.html that allows me to change specific keys (so I changed my Caps Lock to an End key) but I don't know how to ascertain the value of some of the keys, and am wondering if anyone out there knows of a utility that displays keystroke values as you press a key, so that I can utilize the remapping of SharpKeys for the other special keys on the keyboard.

thank you very much

fenixproductions

  • Honorary Member
  • Joined in 2006
  • **
  • Posts: 1,186
    • View Profile
    • Donate to Member
Re: Get keystroke value
« Reply #1 on: June 08, 2009, 05:55 PM »
2HankFriedman
Maybe this will help:
http://www.autohotke...iewtopic.php?t=22881

HankFriedman

  • Supporting Member
  • Joined in 2006
  • **
  • Posts: 147
  • A computer nerd whose also a psychic & astrologer
    • View Profile
    • Welcome to Hank Friedman's Website
    • Read more about this member.
    • Donate to Member
Re: Get keystroke value
« Reply #2 on: June 08, 2009, 06:22 PM »
Dear Fenixproductions,

Thank you for that. I appreciate the time and help you've given me.

I did manage to copy and run the script and get some scancode values (now I know what to call them!) but I guess I'm a bit of a novice and am beginning to realize that SharpKeys is fine for changing one scancode to another, but what I need is that ability to change, for example Win-F (which is the code the Search key on the keyboard generates) to Cntl-F1 (that's control function key one) which is beyond SharpKey's ability it seems, and beyond mine.

I understand that someone familiar with AutoHotKey might write a script to do this, but I neither know how to do this nor how to get such a script to automatically execute with each boot-up.


fenixproductions

  • Honorary Member
  • Joined in 2006
  • **
  • Posts: 1,186
    • View Profile
    • Donate to Member
Re: Get keystroke value
« Reply #3 on: June 08, 2009, 06:33 PM »
I understand that someone familiar with AutoHotKey might write a script to do this, but I neither know how to do this nor how to get such a script to automatically execute with each boot-up.
-HankFriedman (June 08, 2009, 06:22 PM)

I think skrommel might do better job explaining (he is AHK guru here) but I'll try my best:

1. download AHK installation package,
2. take a look on AHK Help file ("Remapping Keys and Buttons" and "Key list (Keyboard, Mouse, Joystick)" chapters or mentioned post on AHK board,
3. write simple script in text editor similar to:

#Persistent
^x::^z

4. compile to EXE using Ahk2Exe.exe tool bundled within AHK package,
5. create shortcut (LNK) for it and put into "Autostart" folder of your Windows "Start" menu.

Sadly: it requires from you time to learn (or search through AHK forum.
Luckily: new knowledge is always big +.

HankFriedman

  • Supporting Member
  • Joined in 2006
  • **
  • Posts: 147
  • A computer nerd whose also a psychic & astrologer
    • View Profile
    • Welcome to Hank Friedman's Website
    • Read more about this member.
    • Donate to Member
Re: Get keystroke value
« Reply #4 on: June 08, 2009, 10:04 PM »
fenixproductions,

I tried to implement what you suggested, and got error codes on execution.

I'm probably making a really silly mistake due to my ignorance of AutoHotKey.

I created this script:

#Persistent
LWin f::Ctrl F1

and whether I have spaces between the LWin and f (and between the Ctrl and F1) or not, it compiles fine but gives me an error message upon execution.

Am I missing a basic syntax statement?  (I also tried including your first line, but got an error message on it too)

Can you or someone help me with this?

thank you very much

HankFriedman

  • Supporting Member
  • Joined in 2006
  • **
  • Posts: 147
  • A computer nerd whose also a psychic & astrologer
    • View Profile
    • Welcome to Hank Friedman's Website
    • Read more about this member.
    • Donate to Member
Re: Get keystroke value
« Reply #5 on: June 08, 2009, 10:33 PM »
I also tried this script:

#f::
Run Everything
return

as well as:

#f::^F1

and both gave me an EXE corrupted error

can't say I'm not trying...   :-)

Target

  • Honorary Member
  • Joined in 2006
  • **
  • Posts: 1,832
    • View Profile
    • Donate to Member
Re: Get keystroke value
« Reply #6 on: June 08, 2009, 10:45 PM »
syntax in this case would be

#persistent

LWin & F::^F1

you could change this to

#persistent

#F::^F1

which removes the dependency on the left win key only

have a read of the hotkeys, Remapping Keys and buttons, & keylist sections of the help file, and don't be afraid to ask for help if you need it

EDIT - as you've already tried the above can you try running the script uncompiled and let us know what happens


HankFriedman

  • Supporting Member
  • Joined in 2006
  • **
  • Posts: 147
  • A computer nerd whose also a psychic & astrologer
    • View Profile
    • Welcome to Hank Friedman's Website
    • Read more about this member.
    • Donate to Member
Re: Get keystroke value
« Reply #7 on: June 08, 2009, 10:52 PM »
Thank you target too.

I tried the EXE first and it gave me the same error

then I tried just running the uncompiled version, good suggestion by the way, and got this error message:

Error at line 3

Line text: ^F1
Error: this line does not contain a recognized function

HankFriedman

  • Supporting Member
  • Joined in 2006
  • **
  • Posts: 147
  • A computer nerd whose also a psychic & astrologer
    • View Profile
    • Welcome to Hank Friedman's Website
    • Read more about this member.
    • Donate to Member
Re: Get keystroke value
« Reply #8 on: June 08, 2009, 10:53 PM »
Oops, the reply was supposed to say action not function.


HankFriedman

  • Supporting Member
  • Joined in 2006
  • **
  • Posts: 147
  • A computer nerd whose also a psychic & astrologer
    • View Profile
    • Welcome to Hank Friedman's Website
    • Read more about this member.
    • Donate to Member
Re: Get keystroke value
« Reply #9 on: June 08, 2009, 10:58 PM »
I got this script to work:

#persistent

LWin & F::
Run C:\Program Files\Everything\Everything.exe
return

but still can't compile it because upon trying to execute the EXE file, it says it is corrupted

HankFriedman

  • Supporting Member
  • Joined in 2006
  • **
  • Posts: 147
  • A computer nerd whose also a psychic & astrologer
    • View Profile
    • Welcome to Hank Friedman's Website
    • Read more about this member.
    • Donate to Member
Re: Get keystroke value
« Reply #10 on: June 08, 2009, 11:23 PM »
I got the compiling to work too!

First I renamed the upx.exe to another name to stop the compression. But that didn't fix the problem (even tho' one forum said it might).

Then I found the tip that worked: delete the exe file and then recompress it. That did the trick!

Why? Because, unbeknownst to me, AutoHotKey has placed in my System Tray the older exe file and by deleting it from the hard drive, I closed the old window.

With no AutoHotKey windows open, and running the EXE, it worked fine.

Thank you all for providing me with the solution I needed.

Hooray!


HankFriedman

  • Supporting Member
  • Joined in 2006
  • **
  • Posts: 147
  • A computer nerd whose also a psychic & astrologer
    • View Profile
    • Welcome to Hank Friedman's Website
    • Read more about this member.
    • Donate to Member
Re: Get keystroke value
« Reply #11 on: June 14, 2009, 12:42 AM »
One last question:

How would I program Alt F4 with AutoHotKey?

I want to get LWin F to trigger Alt F4

and tried the following commands:


LWin & F::LAlt & F4


LWin & F::Alt & F4


LWin & F::! & F4


LWin & F::AltF4


LWin & F::!F4

each one at a time, with #persistent on the first line

and none of them worked.

can anyone help?
« Last Edit: June 14, 2009, 01:01 AM by HankFriedman »

lanux128

  • Global Moderator
  • Joined in 2005
  • *****
  • Posts: 6,277
    • View Profile
    • Donate to Member
Re: Get keystroke value
« Reply #12 on: June 14, 2009, 01:27 AM »
I want to get LWin F to trigger Alt F4
-HankFriedman (June 14, 2009, 12:42 AM)

try this, works on my computer.. :)
#Persistent
#NoEnv

SendMode, Input

~LWin & f::
Send, !{F4}
Return

nogojoe

  • Charter Member
  • Joined in 2006
  • ***
  • Posts: 169
    • View Profile
    • Donate to Member
Re: Get keystroke value
« Reply #13 on: June 14, 2009, 01:29 AM »
One last question:

How would I program Alt F4 with AutoHotKey?
..................
and none of them worked.

can anyone help?
-HankFriedman (June 14, 2009, 12:42 AM)

have you tried the AutoHotkey forum someone there will sure help you and they are very good if someone like yourself have had a go using Autohotkey and can provide the problem in detail and the attempts made as well.
Give them a go then post your solution here when you are successful

nogojoe
Often the most convincing people are those who have lost the plot so much they don't recognize the difference between fact and fantasy

HankFriedman

  • Supporting Member
  • Joined in 2006
  • **
  • Posts: 147
  • A computer nerd whose also a psychic & astrologer
    • View Profile
    • Welcome to Hank Friedman's Website
    • Read more about this member.
    • Donate to Member
Re: Get keystroke value
« Reply #14 on: June 14, 2009, 04:28 PM »
lanux128 saves the day!

That script works perfectly.

I can see that I have a bit of AutoHotKey studying to do, but thank you all so much for all of your superb help!

I am very grateful.