Jump to content


Photo

Function commands gone


  • Please log in to reply
12 replies to this topic

#1 eecer

eecer

    Newbie

  • Members
  • Pip
  • 3 posts

Posted 29 January 2015 - 12:10 PM

So I have been trying to mess around on the key commands to enable the basic functions for volume but have not managed to figure out what I need to enter to get it working.

 

I have tried:

KeyToGrab(F2),            WithModifier(Fn),   	 WithAction(VolumeDown)KeyToGrab(F2),            WithModifier(FN),   	 WithAction(VolumeDown)KeyToGrab(F2),            WithModifier(FUN),   	 WithAction(VolumeDown)KeyToGrab(F2),            WithModifier(Fun),   	 WithAction(VolumeDown)KeyToGrab(F2),            WithModifier(FN),   	 WithAction(VolumeMinus)KeyToGrab(F2),            WithModifier(FN),   	 WithAction(VolDown)KeyToGrab(F2),            WithModifier(FN),   	 WithAction(VolMinus)

Still can't figure it out. Does Blackbox not register the function key? Or am I just missing the the right test to enter?



#2 pitkon

pitkon

    Administrator

  • Head Administrator
  • 1,333 posts
  • LocationAthens & Nafplio, Greece

Posted 29 January 2015 - 01:49 PM

Blackbox does register Function Keys. Silly question, perhaps, but are you sure bbkeys is loaded?



#3 mojmir

mojmir

    BB Developer

  • Moderators
  • 254 posts

Posted 29 January 2015 - 02:27 PM

are you sure? i took a quick peek into sources and nothing suggests that fn is supported



#4 pitkon

pitkon

    Administrator

  • Head Administrator
  • 1,333 posts
  • LocationAthens & Nafplio, Greece

Posted 29 January 2015 - 02:43 PM

are you sure? i took a quick peek into sources and nothing suggests that fn is supported

This is an example from bbkeys.rc itself:

 

# System
KeyToGrab(F10),         WithModifier(Win),      WithAction(Logoff)
KeyToGrab(F11),         WithModifier(Win),      WithAction(Reboot)
KeyToGrab(F12),         WithModifier(Win+Alt),  WithAction(Suspend)
KeyToGrab(F12),         WithModifier(Win+Ctrl), WithAction(Hibernate)
KeyToGrab(F12),         WithModifier(Win),      WithAction(Shutdown)
KeyToGrab(Spacebar),    WithModifier(Win),      WithAction(LockWorkstation)
KeyToGrab®,           WithModifier(Win),      WithAction(Run)


#5 mojmir

mojmir

    BB Developer

  • Moderators
  • 254 posts

Posted 29 January 2015 - 02:44 PM

"The Function switch (Fn) key. Activating this key simultaneously with another key changes that key's value to an alternate character or function. This key is often handled directly in the keyboard hardware and does not usually generate key events. The Function-Lock (FnLock, F-Lock) key. Activating this key switches the mode of the keyboard to changes some keys' values to an alternate character or function. This key is often handled directly in the keyboard hardware and does not usually generate key events."

 

i tried to catch event in windows and there is no windows event generated from pressing Fn..



#6 mojmir

mojmir

    BB Developer

  • Moderators
  • 254 posts

Posted 29 January 2015 - 02:45 PM

That's Win key which is a normal modifier (like control etc). The Fn key is usually on notebooks and stuff, but it seems windows quite ignore it.



#7 pitkon

pitkon

    Administrator

  • Head Administrator
  • 1,333 posts
  • LocationAthens & Nafplio, Greece

Posted 29 January 2015 - 03:08 PM

That's Win key which is a normal modifier (like control etc). The Fn key is usually on notebooks and stuff, but it seems windows quite ignore it.

I see... I was led to believe otherwise. Sorry to hear it, Function Keys could play a big part in adding commands.



#8 mojmir

mojmir

    BB Developer

  • Moderators
  • 254 posts

Posted 29 January 2015 - 03:24 PM

in some cases it could possibly work (seems some keyboards send 0xff (reserved) code for fn key).. but mine does not for example.

hard to rely on to..



#9 diabol

diabol

    Lazyass

  • Validating
  • 236 posts

Posted 29 January 2015 - 07:32 PM

You are all on the wrong track.

 

Just ignore the part about the Fn key being pressed and concentrate on the acutal key.

If your keyboard has an icon ontop of F2, then that's the keypress generated by Fn+FX.

 

A quick look at the sources suggests that you can use

KeyToGrab(VK0XAE) and KeyToGrab(VK0XAF) for volumeup and volumedown and also VK0X..

with the codes from this table: https://msdn.microso...1(v=vs.85).aspx for everything else

 

The format is case-sensitive, so it has to start with VK0X (vee kay zero ex), followed by the two digit code.

So if the table says "VK_Volume_Down 0xAE" you need VK0XAE.

 

That being said, you really need to first find out which virtual key a press of "Fn+F2" generates.

 

All that being said, there apparently used to be KeyToGrab(VolumeUp), but it's commented out, so you need to use the geeky VK0X.. format for that


  • pitkon likes this

#10 diabol

diabol

    Lazyass

  • Validating
  • 236 posts

Posted 29 January 2015 - 07:45 PM

Also, unfortunately teh ability to set volume levels seems to have gone missing in bbZero, so if I'm not mistaken, you'll need an external tool like http://www.nirsoft.n...ils/nircmd.html .



#11 eecer

eecer

    Newbie

  • Members
  • Pip
  • 3 posts

Posted 30 January 2015 - 12:32 AM

You are all on the wrong track.

 

Just ignore the part about the Fn key being pressed and concentrate on the acutal key.

If your keyboard has an icon ontop of F2, then that's the keypress generated by Fn+FX.

 

A quick look at the sources suggests that you can use

KeyToGrab(VK0XAE) and KeyToGrab(VK0XAF) for volumeup and volumedown and also VK0X..

with the codes from this table: https://msdn.microso...1(v=vs.85).aspx for everything else

 

The format is case-sensitive, so it has to start with VK0X (vee kay zero ex), followed by the two digit code.

So if the table says "VK_Volume_Down 0xAE" you need VK0XAE.

 

That being said, you really need to first find out which virtual key a press of "Fn+F2" generates.

 

All that being said, there apparently used to be KeyToGrab(VolumeUp), but it's commented out, so you need to use the geeky VK0X.. format for that

 

 

What if I use the windows key codes for volume down as well? So far I can't find the code for the function key, but lets say I did:

 

(F2)(Razer's Fn) (Volume Down)

KeyToGrab(VK_0x71),         WithModifier(),      WithAction(VK_0xAE)

So far it looks like windows itself has assigned a virtual-key to voume controls. The trick is going to be finding the code for my keyboard's Fn.



#12 eecer

eecer

    Newbie

  • Members
  • Pip
  • 3 posts

Posted 30 January 2015 - 01:08 AM

The other thing I haven't tried but should tonight is applying the functions to Razer's command tool and see if the Fn key will funstion through there. Didn't even think about that.



#13 diabol

diabol

    Lazyass

  • Validating
  • 236 posts

Posted 30 January 2015 - 07:43 AM

The other thing I haven't tried but should tonight is applying the functions to Razer's command tool and see if the Fn key will funstion through there. Didn't even think about that.

As mojmir has pointed out, to windows the Fn key does not exist. If you want to use say (VOLUME_DOWN and VK_0x71) for volume down, you would write:
KeyToGrab(VK0XAE),         WithModifier(),      WithAction(exec yourcommandforvolumedown.bat)KeyToGrab(VK0X71),         WithModifier(),      WithAction(exec yourcommandforvolumedown.bat)
As I said before, the format for specifying the VK directly is VK0X.., VK_0x.. will not work. Also, WithAction takes a bro@m as parameter. If you write WithAction(xyz), bbKeys will fire off @bbCore.xyz when the key is pressed. You can do a lot more than all this by using AutoHotKey. Including built-in functions for volume control. But please bear in mind that all this only works if your F2 key has a secondary function. If it doesn't then Fn+F2 produces exactly the same keycode as F2, which means there's no way to distinguish them
  • pitkon likes this




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users