@Override
    public void keyPressed(NativeKeyEvent nke) {
        // Save Recording
        if (nke.getKeyCode() == NativeKeyEvent.VK_F12) {
        }
        //Load Recording
        if (nke.getKeyCode() == NativeKeyEvent.VK_F10) {
        }
        //Replay Recording
//        if (nke.getKeyCode() == NativeKeyEvent.VK_F9) {
//
//            replaying = !replaying;
//            if (replaying) {
//                System.out.println("Running..m>");
//                Tracker.addTrayMessage("Running",
//                        "Total Run Time ", TrayIcon.MessageType.INFO);
//
//            } else {
//                System.out.println("Obstructed. :( ");
//                long millis = System.currentTimeMillis() - startTime;
//                Tracker.addTrayMessage("Aborted ",
//                        "Time Elapsed: " + String.format("%d m, %d s",
//                        TimeUnit.MILLISECONDS.toMinutes(millis),
//                        TimeUnit.MILLISECONDS.toSeconds(millis)
//                        - TimeUnit.MINUTES.toSeconds(TimeUnit.MILLISECONDS.toMinutes(millis))), TrayIcon.MessageType.WARNING);
//            }
//
//        }
        //Record
        if (nke.getKeyCode() == NativeKeyEvent.VK_F8) {
            thinkTime = 0;
           activateRecorder();
        }

        //Pause
        if (nke.getKeyCode() == NativeKeyEvent.VK_PAUSE) {
//            if (recording) {
//                pauseRecording = true;
//            }
//            if (replaying) {
//                pauseReplay = true;
//            }
            
            recording = !recording;

            if (recording == false) {
                Tracker.addTrayMessage("Paused", "Info related to Pause", TrayIcon.MessageType.INFO);
                //removeNativeHook();
            }else{
                Tracker.addTrayMessage("Resumed Recording", "Info related to Pause", TrayIcon.MessageType.INFO);
            }
        }

        if (recording) {

            int KEY_CODE = nke.getKeyCode();

            if (KEY_CODE != NativeKeyEvent.VK_F8) {
                recorder.keyPress(KEY_CODE);
            }
        }


    }