[OUTDATED] Extra_Keys_Example Code : Utilizing your keyboard
5 posts
• Page 1 of 1
[OUTDATED] Extra_Keys_Example Code : Utilizing your keyboard
!OUTDATED .. bad perfomance! .. New code/example available here
This scripts demonstrates the monitoring of a keyboard and binding actions to the keys via Interactive Configuration.
!Download is removed from the online resource!
Functions added by this example:
key_event_active, key_event_release, key_time_active, key_time_release, key_check_active, key_check_release
Usage:
Assign actions to the keys via each combobox.
Run the script, watch the output panel for information about actions found/taken.
Adding xkeys to your project:
Copy xkeys.gph and xkeys_conf.gph into your scripts directory.
Edit xkeys_conf.gph if you want to change the number of keys and/or the key-names to monitor.
Add the two lines below to near the top of your script:
#include <keyboard.gph>
#include "xkeys.gph"
Call the functions
key_event_active, key_event_release, key_time_active, key_time_release, key_check_active, key_check_release
in your script main{} as you need. They are working similiar to the functions used to check for button states.
This example is based on the code of J2Kbr from here: viewtopic.php?f=26&t=6561#p48550
The code is modified to run in its own main loop in xkeys.gph, so you don't need to add anything else to your main loop except calling the key_ functions you want to use.
New code/example available here
Old code is attached to this post.
This scripts demonstrates the monitoring of a keyboard and binding actions to the keys via Interactive Configuration.
!Download is removed from the online resource!
Functions added by this example:
key_event_active, key_event_release, key_time_active, key_time_release, key_check_active, key_check_release
Usage:
Assign actions to the keys via each combobox.
Run the script, watch the output panel for information about actions found/taken.
Adding xkeys to your project:
Copy xkeys.gph and xkeys_conf.gph into your scripts directory.
Edit xkeys_conf.gph if you want to change the number of keys and/or the key-names to monitor.
Add the two lines below to near the top of your script:
#include <keyboard.gph>
#include "xkeys.gph"
Call the functions
key_event_active, key_event_release, key_time_active, key_time_release, key_check_active, key_check_release
in your script main{} as you need. They are working similiar to the functions used to check for button states.
This example is based on the code of J2Kbr from here: viewtopic.php?f=26&t=6561#p48550
The code is modified to run in its own main loop in xkeys.gph, so you don't need to add anything else to your main loop except calling the key_ functions you want to use.
New code/example available here
Old code is attached to this post.
- Attachments
-
- xkeys_Example_OLD.zip
- (19.65 KiB) Downloaded 103 times
Last edited by Scachi on Tue Oct 02, 2018 12:06 pm, edited 3 times in total.
-
Scachi - Brigadier General
- Posts: 3044
- Joined: Wed May 11, 2016 6:25 am
- Location: Germany
Re: Extra_Keys_Example Code : Utilizing your keyboard
ConsoleTuner Support Team
-
J2Kbr - General of the Army
- Posts: 20323
- Joined: Tue Mar 18, 2014 1:39 pm
Re: Extra_Keys_Example Code : Utilizing your keyboard
I wonder how to do this the other way.
Like havong a game with no Controller support on PC an assigning the Key to the PaD?
Or is that impossible?
Like havong a game with no Controller support on PC an assigning the Key to the PaD?
Or is that impossible?
-
yohimbe - Sergeant Major
- Posts: 84
- Joined: Sun Mar 01, 2015 7:27 pm
Re: Extra_Keys_Example Code : Utilizing your keyboard
yohimbe wrote:I wonder how to do this the other way.
Like havong a game with no Controller support on PC an assigning the Key to the PaD?
Or is that impossible?
I don't think the Titan Two supports "PC Keyboard" as an output option, so you may have to use some pc software for that.
-
Scachi - Brigadier General
- Posts: 3044
- Joined: Wed May 11, 2016 6:25 am
- Location: Germany
Re: Extra_Keys_Example Code : Utilizing your keyboard
The KBM output protocol is in the plans, i remember J2Kbr said he will work on that. For now you have to use a software like Xpadder or joy2key.
Console tuner since my 1st controller.
Scripting, a game in the game.
Believe or dare, It's Titanic!
Scripting, a game in the game.
Believe or dare, It's Titanic!
-
Prototype - Major General
- Posts: 3251
- Joined: Sun Dec 16, 2012 1:43 pm
5 posts
• Page 1 of 1
Return to User's Script Documentation
Who is online
Users browsing this forum: Google [Bot] and 88 guests