Skip to content
Snippets Groups Projects
Commit fb6a6958 authored by Branden's avatar Branden
Browse files

Added Functionality to MediaKeys.

parent 62b9954c
No related branches found
No related tags found
1 merge request!48Feature detect program/launch application
package model;
public class MediaKeys {
}
public class MediaKeys extends Hotkey implements InputEmulator{
// constant for testing
// Play/Pause Media Key: 0xB2
private static int play = Integer.decode("0xB2");
// Mute Media Key: 0xAD
private static int mute = Integer.decode("0xAD");
// Next Media Key: 0xB0
private static int next = Integer.decode("0xB0");
// Prev Media Key: 0xB1
private static int prev = Integer.decode("0xB1");
/**
* Constructs a hotkey
* @param keyCode Virtual keycode
* @param id id of hotkey
* @param modifier modifer for keycode
*/
public MediaKeys (int keyCode, int id, int modifier){
super(keyCode, id , modifier);
}
@Override
public void sendKey(int keyCode, boolean release){
if(keyCode == play){
System.out.println("sending Play keycode" + keyCode);
}
else if (keyCode == mute){
System.out.println("sending mute keycode" + keyCode);
}
else if (keyCode == next){
System.out.println("sending next keycode" + keyCode);
}
else if (keyCode == prev){
System.out.println("sending prev keycode" + keyCode);
}
}
}
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment