Results 1 to 6 of 6

Thread: need advise on adding my ir keyboard to pikey

                  
   
  1. #1
    DCEmu Newbie
    Join Date
    Apr 2008
    Posts
    4
    Rep Power
    0

    Default need advise on adding my ir keyboard to pikey

    I am wondering how much of a hassle it is to add support for my ir keyboard in pikey. Anyone done this themselves? I know I could just buy a targus board but I would really like to make mine work regardless of the time it takes. It is a dhintec. I have some programming experience oldshcool like in basic and machine language from my C64 days and have experience in programming in C+ and serial device input/output mapping to complete small projects I have done in the past (for the old footbal card hacking direct tv... it was fun while it lasted) so I am hoping this wouldnt be much more difficult. Any pointing in the right directions would be greatly appreaciated

  2. #2
    DCEmu Newbie
    Join Date
    Apr 2008
    Posts
    4
    Rep Power
    0

    Default

    well.. i think I got it nailed down as far as what needs to be done..
    1) Get familiar with the keyboard!
    2) Google for pspirdacapture.zip
    Play around and find out what the keyboard sends to PSP
    You might have to use your PC if the keyboard has a non 9600
    baud mode.
    3) Add a new enum to pspirkeyb.h
    4) Add a new function handler to pspirkeyb.c and update pspIrKeybSetKeyboard()
    5) Add a raw mode map to kbdkeyboards.h
    6) Add a new keyboard map to keymap
    7) Test with irkeybtest in RAW mode and SCAN mode

    I found lots of information at http://www.koders.com/noncode/fidA68...8E2587D24.aspx

    Once I get my keyboard working for pikey I will post it here nad since I sit home all day ( I have MS.leisions on my brain..) I will take requests for anyone needing support for a ir keyboard that has none as of yet in pikey. Wish me luck! And of course please post any information you think would be useful.


    edit--
    I have succesfully character mapped what my ir keyboard is sending to my psp but am having trouble making raw mode map in pspirkeyb.c file. on key down it is 192,5,2,*,193 (*=diffrent value on every key) key up is 192,*,*,193 with the 2 values being the same for every key. here is the mapout I have using lua player to run a script that gave me the input values from my keyboard.
    ROW1

    1- 192,5,2,162,193
    192,34,34,193
    2- 192,5,2,254,193
    192,126,126,193
    3- 192,5,2,163,193
    192,35,35,193
    4- 192,5,2,251,193
    192,123,123,193
    5- 192,5,2,250,193
    192,122,122,193
    6- 192,5,2,249,193
    192,121,121,193
    7- 192,5,2,248,193
    192,120,120,193
    8- 192,5,2,203,193
    192,75,75,193
    9- 192,5,2,202,193
    192,74,74,193
    0- 192,5,2,201,193
    192,73,73,193
    -- 192,5,2,207,193
    192,79,79,193
    =- 192,5,2,206,193
    192,78,78,193
    BKSP- 192,5,2,205,193
    192,77,77,193

    ROW2

    TAB- 192,5,2,230,193
    192,102,102,193
    Q- 192,5,2,246,193
    192,118,118,193
    W- 192,5,2,245,193
    192,117,117,193
    E- 192,5,2,244,193
    192,116,116,193
    R- 192,5,2,243,193
    192,115,115,193
    T- 192,5,2,242,193
    192,114,114,193
    Y- 192,5,2,241,193
    192,113,113,193
    U- 192,5,2,195,193
    192,67,67,193
    I- 192,5,2,194,193
    192,66,66,193
    O- 192,5,2,161,193
    192,33,33,193
    P- 192,5,2,160,193
    192,32,32,193
    [- 192,5,2,199,193
    192,71,71,193
    ]- 192,5,2,198,193
    192,70,70,193

    ROW3

    CPLK- 192,5,2,231,193
    192,103,103,193
    A- 192,5,2238,193
    192,110,110,193
    S- 192,5,2,237,193
    192,109,109,193
    D- 192,5,2,236,193
    192,108,108,193
    F- 192,5,2,235,193
    192,107,107,193
    G- 192,5,2,234,193
    192,106,106,193
    H- 192,5,2,233,193
    192,105,105,193
    J- 192,5,2,187,193
    192,59,59,193
    K- 192,5,2,186,193
    192,58,58,193
    L- 192,5,2,185,193
    192,57,57,193
    ;- 192,5,2,184,193
    192,56,56,193
    '- 192,5,2,191,193
    192,63,63,193
    ENTR- 192,5,2,190,193
    192,62,62,193

    ROW4

    SHFT- 192,5,2,167,193
    192,39,39,193
    Z- 192,5,2,252,193
    192,124,124,193
    X- 192,5,2,239,193
    192,111,111,193
    C- 192,5,2,211,193
    192,83,83,193
    V- 192,5,2,210,193
    192,82,82,193
    B- 192,5,2,209,193
    192,81,81,193
    N- 192,5,2,208,193
    192,80,80,193
    M- 192,5,2,179,193
    192,51,51,193
    ,- 192,5,2,178,193
    192,50,50,193
    .- 192,5,2,177,193
    192,49,49,193
    /- 192,5,2,183,193
    192,55,55,193
    UP- 192,5,2,182,193
    192,54,54,193
    SHFT- 192,5,2,167,193
    192,39,39,193

    ROW5

    CTRL- 192,5,2,229,193
    192,101,101,193
    CMD- 192,5,2,247,193
    192,119,119,193
    SYMBL- 192,5,2,240,193
    192,112,112,193
    FN- 192,5,2,221,193
    192,93,93,193
    L SPC- 192,5,2,200,193
    192,72,72,193
    R SPC- 192,5,2,232,193
    192,104,104,193
    ALT- 192,5,2,220,193
    192,92,92,193
    DEL- 192,5,2,175,193
    192,47,47,193
    LEFT- 192,5,2,174,193
    192,46,46,193
    DWN- 192,5,2,173,193
    192,45,45,193
    RGHT- 192,5,2,172,193
    192,44,44,193


    INBOX KEY- 192,5,2,204,193
    192,76,76,193
    CONTACTS KEY- 192,5,2,196,193
    192,68,68,193
    CALENDAR KEY- 192,5,2,189,193
    192,61,61,193
    TASKS KEY- 192,5,2,181,193
    192,53,53,193


    Anyone have some ideas on what I should change in this below to make it work?? it appears to be the closest to what I need with each key down and up inputing multiple values.

    my keyboard is keydown sends=5 with positions 123 and 5 always being the same value and position 4 being diffrent for each key. keyup sends =4 with positions 1 and 4 always being the same value and values 2+3 being a new pair with every difrent key.

    This is for a palm.. the one with the closest keydown/keyup sends..
    * key down sends: 0xFF 0xC0 key ~key key' 0xC1
    * key up sends: 0xFF 0xC0 key+0x80 ~(key+0x80) key'+0x80 0xC1

    static int palmuw(unsigned char* buffer, int *length)
    {
    unsigned char keycode=0;
    unsigned int key_down=0;
    unsigned char buf1;
    int len;
    static int pi = 0;
    static unsigned char pbuf[6] = {0,0,0,0,0,0};

    loop:
    len = sceIoRead(g_irdafd, &buf1, 1);
    if (len <= 0)
    return -1;
    // must be 1... can't be anything else at this point
    if (pi == 0)
    {
    // wait on 0xff
    if (buf1 == 0xff)
    {
    pbuf[0] = 0xff;
    pi++;
    }
    goto loop;
    }

    pbuf[pi] = buf1;
    pi++;
    if (pi < 6)
    goto loop;

    pi = 0;

    /* resume display */
    scePowerTick(0);

    //printf( "0%c - %d\n", buf[0], buf[0] );
    //printf( "1%c - %d\n", buf[1], buf[1] );
    //printf( "5%c - %d\n", buf[5], buf[5] );

    if( pbuf[0] != 0xff || pbuf[1] != 0xc0 || pbuf[5] != 0xc1 )
    return -1;

    //printf( "2%c - %d\n", buf[2], buf[2] );
    //printf( "3%c - %d\n", buf[3], buf[3] );

    if( ( pbuf[2] + pbuf[3] ) != 0xff )
    return -1;

    /* 3rd pos is the key we need */
    keycode = pbuf[2];

    if( keycode < 128 )
    key_down = 1;
    else
    keycode -= 128;

    if ( key_down ) {
    //if (debug)
    //fprintf(stdout,"press %d\n", keycode);
    keymap_decode( g_outputmode, palmuw_normal[keycode], KEY_PRESSED, buffer, length );
    } else {
    //if (debug)
    //fprintf(stderr,"release %d\n", keycode);
    keymap_decode( g_outputmode, palmuw_normal[keycode], KEY_RELEASED, buffer, length );
    }

    return 0;
    }



    Once again.. any help is greatly appreaciated..
    Last edited by robar810; April 26th, 2008 at 04:17.

  3. #3
    DCEmu Coder zx-81's Avatar
    Join Date
    Mar 2006
    Location
    France
    Age
    53
    Posts
    1,805
    Rep Power
    82

    Default

    You can post your comments on ps2dev, i'm sure you will find help over there.

    The 7 points you described are the good way to add a new keyboard. About your particular dhintec keyboard, you have to find the closet existing driver (in your case it seems to be the palm one).

    I haven't written a driver keyboard myself but only used existing one (in irkeyboard library).

    I'm using this simple program to test my targus :
    http://zx81.zx81.free.fr/serendipity...ies/8-Keyboard

    I wish you good luck
    here is my blog !

    Quote Originally Posted by Shadoks rule
    The more you fail, the more you have a chance that it will work in the end.

  4. #4
    DCEmu Newbie
    Join Date
    Apr 2008
    Posts
    4
    Rep Power
    0

    Default

    I am trying. I tried registering at ps2dev but it wont send me the confirmation email and there is no link to contact an administrator so I cannot post there... very fustrating. thanx for the program link.

  5. #5

    Default

    you could make a new keymap or just edit the keymap. I would start by finding the keycodes to all the keys and doing stuff like

    [keycode_number_here]
    Normal = '(letter/number here)';
    Shift = '(well... you know what shift does)';

    here is a list of the scan codes with the name that you can use in the config as well.
    Spoiler!

  6. #6
    DCEmu Newbie
    Join Date
    Apr 2008
    Posts
    4
    Rep Power
    0

    Default

    That helps some but just making a new keymap wont work. The keyboard I have sends 5 chars on keydown and 4 on keyup. thats 9 chars for one keystroke. I have to figure out how to edit the pspirbkey.c file. I have to make it ignore the 1,2,3,5 chars in the keydown and the 1,4 in keyup. The entry I am trying to edit to accomplish this just doesnt seem to make sense.... the math just isnt adding up. Thanks for that list of scancodes though... I didnt have them.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •