Titan Two on PC (not emulating a controller)- beginner help!
12 posts
• Page 1 of 2 • 1, 2
Titan Two on PC (not emulating a controller)- beginner help!
What is the code pattern for taking a basic input, manipulating it, then outputting?
This is my starting point:
What I then need is the equivalent of a:
What is the equivalent when using a Multi Interface HID output? I have the code for "get_val" but I have no idea how to set keyboard outputs, this is uncharted territory for me!
This is my starting point:
- Code: Select all
#include <keyboard.gph>
#include <mouse.gph>
init {
keymapping();
mousemapping();
}
main {
key_passthru();
mouse_passthru();
// Code here
}
What I then need is the equivalent of a:
- Code: Select all
if(get_val(xxxx)) {
// some logic
set_val(xxxx, 100);
}
What is the equivalent when using a Multi Interface HID output? I have the code for "get_val" but I have no idea how to set keyboard outputs, this is uncharted territory for me!
Setup: XIM Apex, T2, K780 keyboard, G Pro Wireless mouse, SteelSeries 4HD pad, DXRacer armrest, LucidSound LS30 headset, Netduma router, Ubiquiti UniFi AP LR
My R6 script: https://youtu.be/x-9NtxyySVM
My R6 script: https://youtu.be/x-9NtxyySVM
-
pablosscripts - Brigadier General
- Posts: 1976
- Joined: Tue Nov 24, 2015 6:27 am
Re: Titan Two on PC (not emulating a controller)- beginner h
output protocol Multi Interface HID
Keyboard
https://www.consoletuner.com/wiki/index ... y_passthru
https://www.consoletuner.com/wiki/index ... t2:key_set
https://www.consoletuner.com/wiki/index ... t2:key_get
Mouse
https://www.consoletuner.com/wiki/index ... e_passthru
https://www.consoletuner.com/wiki/index ... :mouse_set
https://www.consoletuner.com/wiki/index ... :mouse_get
Keyboard
https://www.consoletuner.com/wiki/index ... y_passthru
https://www.consoletuner.com/wiki/index ... t2:key_set
https://www.consoletuner.com/wiki/index ... t2:key_get
Mouse
https://www.consoletuner.com/wiki/index ... e_passthru
https://www.consoletuner.com/wiki/index ... :mouse_set
https://www.consoletuner.com/wiki/index ... :mouse_get
Last edited by Scachi on Sun Apr 14, 2019 9:38 am, edited 2 times in total.
-
Scachi - Brigadier General
- Posts: 3044
- Joined: Wed May 11, 2016 6:25 am
- Location: Germany
Re: Titan Two on PC (not emulating a controller)- beginner h
Also, search for xkeys.gph. That adds a few more kb functions.
-
antithesis - Colonel
- Posts: 1912
- Joined: Sat May 28, 2016 10:45 pm
Re: Titan Two on PC (not emulating a controller)- beginner h
xkeys.gph won't work in multi interface HID mode I think.
It uses key_status to monitor the keys, I think that isn't working for that mode.
It uses key_status to monitor the keys, I think that isn't working for that mode.
-
Scachi - Brigadier General
- Posts: 3044
- Joined: Wed May 11, 2016 6:25 am
- Location: Germany
Re: Titan Two on PC (not emulating a controller)- beginner h
Woo hoo I got it! I didn't get how to use key_set but it makes sense now. Here's the code pattern I got working, now time to get to work on my new script!
- Code: Select all
#include <keyboard.gph>
#include <mouse.gph>
bool key_is_ready;
init {
keymapping();
mousemapping();
}
main {
key_passthru();
mouse_passthru();
if(key_status(KEY_PADASTERISK)) {
key_set(KEY_PADASTERISK, FALSE);
if(key_is_ready) {
key_set(KEY_T, TRUE);
key_is_ready = 0;
}
} else {
key_is_ready = 1;
}
}
Setup: XIM Apex, T2, K780 keyboard, G Pro Wireless mouse, SteelSeries 4HD pad, DXRacer armrest, LucidSound LS30 headset, Netduma router, Ubiquiti UniFi AP LR
My R6 script: https://youtu.be/x-9NtxyySVM
My R6 script: https://youtu.be/x-9NtxyySVM
-
pablosscripts - Brigadier General
- Posts: 1976
- Joined: Tue Nov 24, 2015 6:27 am
Re: Titan Two on PC (not emulating a controller)- beginner h
Scachi wrote:xkeys.gph won't work in multi interface HID mode I think.
It uses key_status to monitor the keys, I think that isn't working for that mode.
Good to know, thanks Scachi!
Glad you've got it working piiwii.
-
antithesis - Colonel
- Posts: 1912
- Joined: Sat May 28, 2016 10:45 pm
Re: Titan Two on PC (not emulating a controller)- beginner h
antithesis wrote:Scachi wrote:xkeys.gph won't work in multi interface HID mode I think.
It uses key_status to monitor the keys, I think that isn't working for that mode.
Good to know, thanks Scachi!
Glad you've got it working piiwii.
Looks like I was wrong and key_status works in HID mode too as his code uses it.
-
Scachi - Brigadier General
- Posts: 3044
- Joined: Wed May 11, 2016 6:25 am
- Location: Germany
Re: Titan Two on PC (not emulating a controller)- beginner h
Sweet! I'm so excited to be coding for PC now:)
Setup: XIM Apex, T2, K780 keyboard, G Pro Wireless mouse, SteelSeries 4HD pad, DXRacer armrest, LucidSound LS30 headset, Netduma router, Ubiquiti UniFi AP LR
My R6 script: https://youtu.be/x-9NtxyySVM
My R6 script: https://youtu.be/x-9NtxyySVM
-
pablosscripts - Brigadier General
- Posts: 1976
- Joined: Tue Nov 24, 2015 6:27 am
Re: Titan Two on PC (not emulating a controller)- beginner h
pablosscripts wrote:What is the code pattern for taking a basic input, manipulating it, then outputting?
This is my starting point:
- Code: Select all
#include <keyboard.gph>
#include <mouse.gph>
init {
keymapping();
mousemapping();
}
main {
key_passthru();
mouse_passthru();
// Code here
}
What I then need is the equivalent of a:
- Code: Select all
if(get_val(xxxx)) {
// some logic
set_val(xxxx, 100);
}
What is the equivalent when using a Multi Interface HID output? I have the code for "get_val" but I have no idea how to set keyboard outputs, this is uncharted territory for me!
Trick question: is it possible to passthru only the "movement" of the mouse? Because my goal is to remap and script the mouse buttons...
-
Brunissimus - Staff Sergeant
- Posts: 10
- Joined: Tue Apr 11, 2017 11:34 am
Re: Titan Two on PC (not emulating a controller)- beginner h
Brunissimus wrote:Trick question: is it possible to passthru only the "movement" of the mouse? Because my goal is to remap and script the mouse buttons...
- Code: Select all
#include <mouse.gph>
init {
mousemapping();
}
main {
if(mouse_status(MREPORT_UPDATED)) {
mouse_set(MOUSE_X, mouse_status(MOUSE_X));
mouse_set(MOUSE_Y, mouse_status(MOUSE_Y));
}
}
ConsoleTuner Support Team
-
J2Kbr - General of the Army
- Posts: 20323
- Joined: Tue Mar 18, 2014 1:39 pm
12 posts
• Page 1 of 2 • 1, 2
Return to GPC2 Script Programming
Who is online
Users browsing this forum: No registered users and 172 guests