send outputs via ps2 format

I am working on a project where i have two push buttons. One sends a "0" and the other sends a "1".
I have the program working to where i can see that the buttons are functioning on the COM Serial Monitor when plugged in via USB.

What i am wanting to do is have it send a signal as a PS2 format over a RJ12 6 wire connection.
How should i go about transmitting this with the data and the clock?
Do i need to include the ps2dev.h in the code?
I am not using a keyboard just wanting to send data over the RJ12 connection as the Arduino was a keyboard. I am using a Pro Micro. So far i have the ground and the power hooked up. Yellow to the RAW and the Green to the ground.

I have my code so far attached.
Thanks,

Keyboard01.ino (872 Bytes)

Don't attach the code. Just post it inside code tags.

Here is his code:

#include "Keyboard.h"

const int button1Pin = 3;  // pushbutton 1 pin
const int button2Pin = 5;  // pushbutton 2 pin


void setup() {

    //  open the serial port:
    Serial.begin(9600);
    //  initialize control over the keyboard:
    //  Keyboard.begin();

    pinMode(button1Pin, INPUT);
    pinMode(button2Pin, INPUT);
    //Keyboard.begin();

}

void loop() 
{
    int button1State, button2State;  // variables to hold the pushbutton states

    button1State = digitalRead(button1Pin);
    button2State = digitalRead(button2Pin);


    if(button1State == HIGH)
    {
        Serial.println('0');
        //Keyboard.begin();
        //Keyboard.write(48);  
        //  Keyboard.end(); 
        delay(1000);
        return;
    }

    if(button2State == HIGH)
    {
        Serial.println('1');
        //Keyboard.begin();
        // Keyboard.write(49);
        //Keyboard.end();
        delay(1000);
        
        return;
    }
}

Here's a starter on using PS2 on arduino:

http://playground.arduino.cc/Main/PS2Keyboard

Thanks for the link. I am not looking at hooking up a PS2 keyboard to the device.
I am wanting the ardunio to act as a keyboard that has only two mechanical buttons.
I then want to send the data out as if it were a key board hooked to a PC with the 6 wire rj12 cable.
The RJ12 will supply the power to the ardunio and the mirco USB will not be used in production.

mcguffeyd1:
Thanks for the link. I am not looking at hooking up a PS2 keyboard to the device.
I am wanting the ardunio to act as a keyboard that has only two mechanical buttons.
I then want to send the data out as if it were a key board hooked to a PC with the 6 wire rj12 cable.
The RJ12 will supply the power to the ardunio and the mirco USB will not be used in production.

Yes, but the link gives you an understanding of how to communicate using PS2 protocols with an Arduino.