Top sellers


Product Code: jpshortcut
Availability: In Stock
Built for: Associate your game actions with customizable shortcuts (keys, mouse/joypad buttons).
Product Version: 2.0
Online Demo: http://www.julien-pierron.com/sample?sample=jpshortcutsample
Forum Link: http://www.shiva-engine.com/forum/viewtopic.php?f=82&t=29258
Req. ShiVa Version: ShiVa 1.9.2 Engines
Plugin Platform Compatibility: iOS, Android, WinRT ARM/Phone 8, WinRT x86/_64, Windows Legacy, Mac OS X, Linux, Flash, Web Browser, Palm, Marmalade, BlackBerry, Windows Phone 7, Playstation 3, Playstation 4, Xbox 360, Xbox One, Wii, tvOS
Price: $39.00
Seller information: Julien Pierron
Country: France, Metropolitan
Company: Julien Pierron
Qty:     - OR -   Wish List
In your game, when you want to do an action like moving a character, you will be listening to the keyboard events, to know if the key to move forward, backward or to start a specific action is pressed or released. That's great, but as soon as you allow the user to customize the actions key, it becomes much more complicated.

With JPShortcut, you will be listening for action events instead of keys. JPShortcut will send you events to let you know when an action shortcut is pressed or released, whatever the shortcut is.

JPShortcut embeds functions to be called by your shortcut editor interface. Tell JPShortcut that the "Forward" action has been clicked by the user to be edited, and JPShortcut will automatically change the shortcut as soon as a new key is pressed, and will notify you of the new key to let you update the interface with the new action key name.

JPShortcut is compatible with mouse buttons as well as joypad buttons.

Here is a quick example, starting from the setup step:

function JPShortcutSample.onInit ( )

JPShortcut.createAction ( "Forward", input.kKeyUp )
JPShortcut.createAction ( "Backward", input.kKeyDown )
JPShortcut.createAction ( "Left", input.kKeyLeft )
JPShortcut.createAction ( "Right", input.kKeyRight )
JPShortcut.createAction ( "Crouch", input.kKeySpace ) --Special action


Here's the code if you want to do something as long as the action shortcut is pressed:

function JPShortcutSample.onEnterFrame ( )

if ( JPShortcut.isActionShortcutDown ( "Forward" ) )
--Move forward

--Same for the other actions


And here the code for actions called once, in the onActionShortcutPressed (or Released) handler, automatically called by JPShortcut when the action is triggered:

function JPShortcutSample.onActionShortcutPressed ( sAction )

if ( sAction == "Crouch" )
--do the crouch action


In these 2 cases, even if the shortcut changes, your script remain the same as it is looking for actions state instead of keys or buttons states.

General information :
- This product is compatible with both ShiVa 1.9.2 and 2.0.

- ShiVa 1.9.2 or greater´╗┐´╗┐´╗┐
- LUA project (not compatible with full c++ projects, compatible with LUA projects that use c++ plugins)

You can find an introduction to the packs and how to load them in your game here:

API & Instructions


Sample projects that use my packs

Write a review

Your Name:

Your Review: Note: HTML is not translated!

Rating: Bad           Good

Enter the code in the box below:

ShiVa Store © 2019 - Powered By OpenCart