Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Media keys with intercept #42

Open
Ingvix opened this issue Mar 2, 2018 · 12 comments
Open

Media keys with intercept #42

Ingvix opened this issue Mar 2, 2018 · 12 comments

Comments

@Ingvix
Copy link

Ingvix commented Mar 2, 2018

Hey, I was looking around the internet for answers and ended up here.

You seem fairly experienced with intercept.exe so I wonder if you would know scancodes, or how to find them out, for media keys? I'm in the need for previous, next and play/pause. My own laptop keyboard does not contain them so I can't just press and see. I'm trying to configure my external numpad for various purposes, media controls being one. Or maybe I can't get the media key mapping done with just intercept and I need to use AHK with it? If I can I'd rather use only intercept rather than using them both so any info would be useful.

@TaranVH
Copy link
Owner

TaranVH commented Mar 2, 2018

In any AHK script that has a keyboard hook installed, you can open it and go to View > key history and script info. Then hit your keys, and hit F5 to refresh the view. TAH DAAAAAAAAAAAA


VK  SC	Type	Up/Dn	Elapsed	Key		Window

74  03F	 	u	0.11	F5             	
B0  119	#	d	0.38	Media_Next     	
B0  119	#	u	0.09	Media_Next     	
74  03F	#	d	0.14	F5             	
74  03F	 	u	0.13	F5             	
B2  124	#	d	0.69	Media_Stop     	
B2  124	#	u	0.13	Media_Stop     	
74  03F	#	d	0.09	F5             	
74  03F	 	u	0.11	F5             	
B1  110	#	d	0.33	Media_Prev     	
B1  110	#	u	0.08	Media_Prev     	
74  03F	#	d	0.13	F5             	
74  03F	 	u	0.13	F5             	
B3  122	#	d	0.14	Media_Play_Pause	
B3  122	#	u	0.11	Media_Play_Pause	

@TaranVH TaranVH closed this as completed Mar 2, 2018
@TaranVH TaranVH reopened this Mar 2, 2018
@TaranVH
Copy link
Owner

TaranVH commented Mar 2, 2018

does that answer joor quetsioonnnn

@Ingvix
Copy link
Author

Ingvix commented Mar 2, 2018

I'm still a bit confused. I tried to edit the intercept ini file by using combo 122,0,0|122,0,1 but when I look through the intercept, it says it's letter G rather than play/pause. Am I misinterpreting the scancode in your log? I tried to assign F5 with it and then I looked at the ini file and there it's scancode was 3F and not 03F. Should the first number be placed in some other manner or be ignored?

If you could create a dummy ini file with the media keys in the trigger or combo and paste some lines from the ini, it would be helpful.

@Ingvix
Copy link
Author

Ingvix commented Mar 2, 2018

and as I tried to say, I don't have any media keys to press to I can't log them in the keyboard hook.

@TaranVH
Copy link
Owner

TaranVH commented Mar 2, 2018

Oh, sorry. You have to use hexadecimal.
122 is 7A
https://www.rapidtables.com/convert/number/decimal-to-hex.html
I didn't notice 'cause I've been scripting long enough that I don't even think about it.

so like, try this:
[f5 to Media_Play_Pause]
device=HID\VID_046D&PID_C31C&REV_6400&MI_00 [replace this line with your own]
trigger=3f,0,0
combo=7A,0,0|7A,0,1

Keep in mind, it might also be
combo=7A,0,2|7A,0,3

@TaranVH
Copy link
Owner

TaranVH commented Mar 2, 2018

But like, are you building a second keyboard? Or are you just making modifications to your main keyboard? If so, using interception is WAY OVERKILL.
You can just use autoHotKey for that. Here's the code:

F4::Media_Prev
F5::Media_Play_Pause
F6::Media_Next

@Wegerich
Copy link
Contributor

Wegerich commented Mar 3, 2018

His laptop doesn't have the media keys so he wants to use an external numpad to serve their purpose.

Ingvix: what I would recommend is that you set up LuaMacros with autohotkey which is rather simpler to get running and works fantastically well. I can't remember why it didn't suit Taran but it is working perfectly for me to use a numpad as a media keyboard.

@TaranVH
Copy link
Owner

TaranVH commented Mar 3, 2018

Luamacros only supports one key at a time, but I need to be able to use modifier keys.
It also sometimes fails to work, especially on the function keys.

@Ingvix
Copy link
Author

Ingvix commented Mar 3, 2018

It doesn't seem to work for me. I'm not sure but on my journey looking for answers I learned that there are a few different standard sets for scancodes or something like that? Maybe my laptop has a different to yours. Thanks for the info anyway. If you got more suggestions I'm happy to hear them.

Today I'm probably going to borrow an external keyboard with the media keys from my friend so with that this mystery will probably be solved. If for some reason not, I guess I just go for some workaround with AHK. I'll also look in to the luamacros if that's any better for me.

@Wegerich
Copy link
Contributor

Wegerich commented Mar 3, 2018

@TaranVH I fixed the issue with LUAmacros not accepting modifier keys, try it now, the latest version should work as you merged the changes :) I am lucky that I don't think it's ever failed for me but yes, that would be an achilles heel for gamers.

Sorry I can't be any help with intercept Ingvix, but do let me know if you move to LUAmacros as I am having perfect results with it running a numpad as a media controller.

@Ingvix
Copy link
Author

Ingvix commented Mar 3, 2018

@TaranVH While we're still at it, I need to ask how do you manage with the cmd windows? Do you just use some vbs script or something as simple to hide them? I've tried to find a way to have them hidden as they launch but with capalitity to show if needed them for easier management. So far I've only found resolutions that either hide at launch or with the capability to show them again but not these both together.

@Ingvix
Copy link
Author

Ingvix commented Mar 3, 2018

The SC section is actually showing the hexadecimal and should not be converted again. I just checked that AHK keyboard hook shows 023 for H and tested that intercept uses 23 too while hexadecimal for 023 would be 35.

Also it seems that for some reason intercept doesn't register media buttons at all as I tried them with the borrowed keyboard. And I did check that they were fully functioning otherwise. That also explains why using 122 in ini file didn't work. So I guess I need to use AHK with intercept to get the desired effect.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants