private void initialize(JComponent component) {
        component.addKeyListener(new KeyListener() {
            
            @Override
            public void keyPressed(KeyEvent e) {
                notifyInputAction("Keyboard_Any_Down", new AlertObject(e.getWhen()));
                String keyName = KeyboardMappings.getKeyName(e.getKeyCode());
                ButtonState downKey = new ButtonState(DEVICE, keyName, e.getWhen(), inDev);
                notifyInputAction(downKey.getFullName() + "_KeyDown", new AlertObject(e.getWhen())); //Legacy Support
                if (!myDownKeys.contains(downKey)){
                    if(myDownKeys.size() > 1) {
                        recursiveCombination(myDownKeys, e.getWhen(), downKey);
                    }
                    myDownKeys.add(downKey);
                }
                else
                    notifyInputAction(downKey.getFullName() + "_LongPress",new AlertObject(e.getWhen()));
                
                ArrayList<ButtonState> buttonArray = (ArrayList<ButtonState>) myDownKeys.clone();
                if(buttonArray.size() > 1)
                    recursivePermutation("", buttonArray, buttonArray.size(), e.getWhen());
            }

            @Override
            public void keyReleased(KeyEvent e) {
                notifyInputAction("Keyboard_Any_Up", new AlertObject(e.getWhen()));
                String keyName = KeyboardMappings.getKeyName(e.getKeyCode());
                ButtonState temp = new ButtonState(DEVICE, keyName, e.getWhen(), inDev);
                int keyIndex;
                if( (keyIndex = myDownKeys.indexOf(temp)) != -1 ) {
                    long timeDifference = temp.getTime() - myDownKeys.remove(keyIndex).getTime();
                    notifyInputAction(temp.getFullName() + "_Up", new AlertObject(e.getWhen()));
                    notifyInputAction(temp.getFullName() + "_KeyUp", new AlertObject(e.getWhen())); //Legacy Support
                    if (timeDifference < Integer.parseInt(myInput.getSetting("ShortClickTimeThreshold")) ) {
                        notifyInputAction(temp.getFullName() + "_ShortClick",
                                new AlertObject(e.getWhen()));
                    }
                    if (timeDifference >= Integer.parseInt(myInput.getSetting("LongClickTimeThreshold"))) {
                        notifyInputAction(temp.getFullName() + "_LongClick",
                                new AlertObject(e.getWhen()));
                    }
                    if (lastClickKey.equals(keyName) && e.getWhen() - lastClickTime < Integer.parseInt(myInput.getSetting("DoubleClickTimeThreshold"))) {
                        notifyInputAction(temp.getFullName() + "_DoubleClick", new AlertObject(e.getWhen()));
                    }
                    lastClickTime = e.getWhen();
                    lastClickKey = keyName;
                }
            }

            @Override
            public void keyTyped(KeyEvent e) {
            }
        });
    }