Sign in to follow this  
Followers 0
Trystian

Keyboard: Special key detection

14 posts in this topic

#1 ·  Posted (edited)

Greetings everyone,

I am attempting to make a program that detects the special keyboard keys so that when someone presses one, it will launch a URL or program. The reason I'm not using something like iTouch, Intellitype Pro, or any other such software, is that it doesn't work with all the special keys on my current keyboard (eMachines KB-0108), and the software that is available for this keyboard doesn't let you customize functionality.

My question: Is there a way to detect the keycode/scancode for the special function keys, then use that code in the HotKeySet function? Some keys use the standard codes that AutoIT3 can detect (MEDIA_NEXT,MEDIA_PREV,MEDIA_STOP,MEDIA_PLAY_PAUSE, etc.), but others just don't seem to work. I've tried HotKeySet ( "{ASC 0xxx}", "fcnTest"), with xxx being 000 -> 031 and 128 -> 255, but to no avail.

Here is the basic code:

HotKeySet ( "{LAUNCH_APP1}", "fcnTest")

While 1=1
    Sleep(100)
WEnd

Func fcnTest()
    msgbox(0,"Key Test","Keypress: LAUNCH_APP1")
    ; Launch URL or Program
EndFunc

The keys I'd like to give special functions to are:

  • Cut
  • Copy
  • Paste
  • Sleep
  • Calulator
  • Media Play/Pause
  • Media Previous
  • Media Next
  • Media Stop
  • Media Mute
  • Media Vol Up
  • Media Vol Down
  • Internet
  • E-mail
  • Search
  • Backward
  • Forward
  • Favorite
Here's a visual of my keyboard (with special buttons labelled):

Posted Image

Any help would be appreciated.

-Trystian Edited by TrystianSky

Share this post


Link to post
Share on other sites



#2 ·  Posted (edited)

{VOLUME_MUTE} 2000/XP Only: Mute the volume

{VOLUME_DOWN} 2000/XP Only: Reduce the volume

{VOLUME_UP} 2000/XP Only: Increase the volume

{MEDIA_NEXT} 2000/XP Only: Select next track in media player

{MEDIA_PREV} 2000/XP Only: Select previous track in media player

{MEDIA_STOP} 2000/XP Only: Stop media player

{MEDIA_PLAY_PAUSE} 2000/XP Only: Play/pause media player

{LAUNCH_MAIL} 2000/XP Only: Launch the email application

{LAUNCH_MEDIA} 2000/XP Only: Launch media player

{LAUNCH_APP1} 2000/XP Only: Launch user app1

{LAUNCH_APP2} 2000/XP Only: Launch user app2

That have anything to do with what you want?

EDIT::

Ignore this post.

Edited by AzKay

# MY LOVE FOR YOU... IS LIKE A TRUCK- #

Share this post


Link to post
Share on other sites

{VOLUME_MUTE} 2000/XP Only: Mute the volume

{VOLUME_DOWN} 2000/XP Only: Reduce the volume

{VOLUME_UP} 2000/XP Only: Increase the volume

{MEDIA_NEXT} 2000/XP Only: Select next track in media player

{MEDIA_PREV} 2000/XP Only: Select previous track in media player

{MEDIA_STOP} 2000/XP Only: Stop media player

{MEDIA_PLAY_PAUSE} 2000/XP Only: Play/pause media player

{LAUNCH_MAIL} 2000/XP Only: Launch the email application

{LAUNCH_MEDIA} 2000/XP Only: Launch media player

{LAUNCH_APP1} 2000/XP Only: Launch user app1

{LAUNCH_APP2} 2000/XP Only: Launch user app2

That have anything to do with what you want?

Some of these do work, but others don't. Plus these don't cover all the keys that I need to add custom functionality to.

Perhaps I'll have to use a DLL that taps into the Keyboard Hooks. I'd rather not use this approach if there is a built-in way to do this in AutoIT.

Share this post


Link to post
Share on other sites

Theres a send key list in the help file


# MY LOVE FOR YOU... IS LIKE A TRUCK- #

Share this post


Link to post
Share on other sites

#5 ·  Posted (edited)

Theres a send key list in the help file

I've read it, but it doesn't help with this issue. Hence the reason for this post. :D

Thanks,

-Trystian

Edited by TrystianSky

Share this post


Link to post
Share on other sites

Ah.


# MY LOVE FOR YOU... IS LIKE A TRUCK- #

Share this post


Link to post
Share on other sites

Nice keyboard. This what you want (function for detecting keys) possibly can be use like a keylogger. That's only a blanket statement and not personally!

Please everyone correct me if I'm wrong.

Share this post


Link to post
Share on other sites

#8 ·  Posted (edited)

I was hoping THAT word wouldn't creep into this topic. And no, I'm not taking it personally.

Yes, I want to use this to detect ONLY the "special" keys on my keyboard to be able to launch programs and/or URL's. Just like Microsoft's Intellitype, or Logitech's iTouch/SetPoint software. NO KEYLOGGING.

My old keyboard was so messed up that I had to switch. I was so used to my old Logitech keyboard's extra key functionality that I'm having seizures now that I don't have that with this new keyboard. So, I thought I'd write my own application with AutoIT to help with this issue.

Even though there are an unlimited number beneficial things that can be created with AutoIT, there will always be people who exploit it for truly ugly and negative purposes. I am not one of those people.

Edited by TrystianSky

Share this post


Link to post
Share on other sites

#9 ·  Posted (edited)

So, anyone have any ideas?

Edited by TrystianSky

Share this post


Link to post
Share on other sites

I can't believe there is nobody out there that hasn't overcome this issue. ANY help would be greatly appreciated.

Thank you,

-Trystian

Share this post


Link to post
Share on other sites

#11 ·  Posted (edited)

I can't believe there is nobody out there that hasn't overcome this issue. ANY help would be greatly appreciated.

Thank you,

-Trystian

This really has nothing to do with autoit, since the keys don't all have IDs to detect when they are pressed, therefore, your best bet would be to google for your keyboard, and see if there is a configuration utility that you need to download for it that sets up those keys for you.

If that turns up nothing, well contact the manufacturer, they'll give you the tools you need to configure them, otherwise, whats the point in having the keys?

Edited by Paulie

Share this post


Link to post
Share on other sites

This really has nothing to do with autoit, since the keys don't all have IDs to detect when they are pressed, therefore, your best bet would be to google for your keyboard, and see if there is a configuration utility that you need to download for it that sets up those keys for you.

If that turns up nothing, well contact the manufacturer, they'll give you the tools you need to configure them, otherwise, whats the point in having the keys?

I found the only keyboard driver made for this keyboard (Chicony PS/2 KB-0108 - made in Taiwan), BUT, the functions are all hardcoded into the drivers. All the keys MUST have an ID/scancode for the driver to assign it a function. There isn't any documentation anywhere on the net that I have found that gives the codes for each of the special keys for this keyboard. I have tried contacting the manufacturer, but so far have gotten no reply.

What I am looking for it some way to detect the codes for each of these special keys, and be able to write custom functions in Autoit to be able to assign a custom URL or Program to each of these keys. I can do it with some with the built-in HotkeySet function, but not all the special keys.

With the new Autoit Beta, there is the SEND("{ASC 0000}"), but can that format be used for the HotKeySet function [HotKeySet("{ASC 0000}",fcnDoSomething)]. 0000 being a keycode 0000-9999.

Share this post


Link to post
Share on other sites

I found the only keyboard driver made for this keyboard (Chicony PS/2 KB-0108 - made in Taiwan), BUT, the functions are all hardcoded into the drivers. All the keys MUST have an ID/scancode for the driver to assign it a function. There isn't any documentation anywhere on the net that I have found that gives the codes for each of the special keys for this keyboard. I have tried contacting the manufacturer, but so far have gotten no reply.

What I am looking for it some way to detect the codes for each of these special keys, and be able to write custom functions in Autoit to be able to assign a custom URL or Program to each of these keys. I can do it with some with the built-in HotkeySet function, but not all the special keys.

With the new Autoit Beta, there is the SEND("{ASC 0000}"), but can that format be used for the HotKeySet function [HotKeySet("{ASC 0000}",fcnDoSomething)]. 0000 being a keycode 0000-9999.

Well, i think those keys need to be programed into autoit as well, hotkeyset has specific ways that it uses to know if a certain key is pressed, and i'm not totally sure, but i don't think its capable of accepting keys that aren't programed into it. so I'd just harass your supplier/manufacturer and say:

"I paid my good money for this keyboard because I thought it was actually going to run the applications i wanted when i push these hotkeys, how do i configure it?"

They cant have no way of configuring it, unless the applications that it was initially supposed to run work

Ex.

If the calculator button actually starts calculator, but you want to make it start wordpad, you might not be able to do that, because the manufacturer set the hotkeys up to only accept certain things

if it's not working call manufacturers tech support and say

"the calculator button doesn't start calculator"

Share this post


Link to post
Share on other sites

This might help - open regedit at the following key :

HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\AppKey

you can change the action for the multimedia keys etc there.

More info : http://www.microsoft.com/mspress/books/sampchap/6232.asp - scroll down to "Command Keys" near the bottom.

Or TweakUiXP does the same thing - look in Explorer / Command Keys

.

Share this post


Link to post
Share on other sites

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 account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0