[Question] Connecting Keyboard and Mouse to T2 - PS4-Solved
23 posts
• Page 3 of 3 • 1, 2, 3
Re: [Question] Connecting Keyboard and Mouse to T2 - PS4
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.
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;
}
}
}
}
-
Scachi - Brigadier General
- Posts: 3044
- Joined: Wed May 11, 2016 6:25 am
- Location: Germany
Re: [Question] Connecting Keyboard and Mouse to T2 - PS4
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
- Create your own scripts with GPC2 Scripting
-
jelly44 - Sergeant Major of the Army
- Posts: 220
- Joined: Tue Feb 05, 2019 3:49 pm
Re: [Question] Connecting Keyboard and Mouse to T2 - PS4
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
- Create your own scripts with GPC2 Scripting
-
jelly44 - Sergeant Major of the Army
- Posts: 220
- Joined: Tue Feb 05, 2019 3:49 pm
23 posts
• Page 3 of 3 • 1, 2, 3
Who is online
Users browsing this forum: Majestic-12 [Bot] and 106 guests