[Question] Connecting Keyboard and Mouse to T2 - PS4-Solved

Titan Two general support. Questions, firmware update, feature request.

Re: [Question] Connecting Keyboard and Mouse to T2 - PS4

Postby Scachi » Wed Jul 17, 2019 8:05 am

Can be fault of your script or some keyboard issue, post or pm your script if you need help.
To test the keyboard you can run this script and check the output in the "Device Monitor" when you press the keys.
Code: Select all
#include <keyboard.gph>
#include <mouse.gph>
 
main {
  output_keycode();
  output_mouse();
}
 
void output_keycode() {
    static uint8 previous_keycode;
    uint8 keycode;
 
    keycode = key_check();
    if(keycode != previous_keycode) {
        if(keycode) {
            printf("Keypress, Key Code: %02X", keycode);
        }
        previous_keycode = keycode;
    }
    return;
}
 
void output_mouse() {
  int8 i, wheel;
  static int8 m[20];
  if (mouse_status(MREPORT_UPDATED)) {
    if (wheel=mouse_status(MOUSE_WHEEL)) {
      if (wheel==1) printf("Mouse Wheel Forward");
      if (wheel==-1) printf("Mouse Wheel Backward");
    }
    for (i=4;i<19;i++) {
      if (mouse_status(i)) {
        if (m[i]==0) printf("Mouse Button pressed: %d",i-3);
        m[i]=1;
      } else {
        if (m[i]==1) printf("Mouse Button released: %d",i-3);
        m[i]=0;
      }
    }
  }
}
User avatar
Scachi
Brigadier General
Brigadier General
 
Posts: 3044
Joined: Wed May 11, 2016 6:25 am
Location: Germany

Re: [Question] Connecting Keyboard and Mouse to T2 - PS4

Postby jelly44 » Wed Jul 17, 2019 8:13 am

Thanks, Scachi. PM sent - I will test your scrip tomorrow!
- My recommendation for learning C programming: 'C Programming Absolute Beginner's Guide'
- Create your own scripts with GPC2 Scripting
User avatar
jelly44
Sergeant Major of the Army
Sergeant Major of the Army
 
Posts: 220
Joined: Tue Feb 05, 2019 3:49 pm

Re: [Question] Connecting Keyboard and Mouse to T2 - PS4

Postby jelly44 » Sun Jul 21, 2019 7:21 am

Thank you, all for your support. Somehow the numpad started working!
- My recommendation for learning C programming: 'C Programming Absolute Beginner's Guide'
- Create your own scripts with GPC2 Scripting
User avatar
jelly44
Sergeant Major of the Army
Sergeant Major of the Army
 
Posts: 220
Joined: Tue Feb 05, 2019 3:49 pm

Previous

Return to Titan Two Device

Who is online

Users browsing this forum: Majestic-12 [Bot] and 106 guests