Results 1 to 4 of 4
  1. #1
    Member Cotaks's Avatar
    Join Date
    May 2012
    Location
    The Netherlands
    Posts
    1,235

    Key and mouse bindings

    Hello,

    I have rebuild my own keybindings script and included mouse buttons.


    How it works:

    - On a press of a button the script listen to our keyboard and mouse, once we get an input we put it into the global dict.
    - The global dict is used to save, load and use all the keybindings.


    How to use:


    - Hit K to open the keybindings menu.
    - Click on a button to set a new key or mouse button.
    - Hit save or the close button to save and close the menu


    How to port it to your game:

    - Import the empty from the main scene into your main scene.
    - Import the keybindings scene into your blend file (file->append).
    - Make sure you have keybindings.py and my_functions.py aswell.
    - Go to keybindings.py and change the scene names at the top of the script


    How to add more Buttons/keys:


    - Select 1 button and the text object, duplicate it, change the property to your likings
    - Now go to keybindings.py head to def default_keybindings(cont): and set the key there as well
    - Done!


    Key and mouse bindings in action:


    *** This version has only the keybindings, no movement system or anything else attached. ***


    Download:
    key and mouse bindings.blend


    As always if you like it or gonna use it leave a reply, thanks!

    Cotax
    '- It's not working' then check your console like: this
    Did you know that you can make a complete game with the .blends that i share?



  2. #2
    Very nice!
    Last edited by Asdfghjkl; 19-Mar-17 at 06:32.



  3. #3
    Where do I get this ??? keybindings.py and my_functions.py



  4. #4
    Member Cotaks's Avatar
    Join Date
    May 2012
    Location
    The Netherlands
    Posts
    1,235
    Originally Posted by Mauzz View Post
    Where do I get this ??? keybindings.py and my_functions.py
    They are included in the blend file. you can just copy/paste the scripts and put it in your blend.
    or you can append it into your blend
    or you can save the scripts as a file and then load it in your blend.
    '- It's not working' then check your console like: this
    Did you know that you can make a complete game with the .blends that i share?



Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •