User Tag List

Results 1 to 10 of 10

Thread: Mapping Keyboard Buttons Question.

  1. #1
    Clicker Fusion 2.5 DeveloperSWF Export Module
    N64Mario's Avatar
    Join Date
    Nov 2008
    Location
    USA
    Posts
    1,306
    Mentioned
    15 Post(s)
    Tagged
    0 Thread(s)

    Mapping Keyboard Buttons Question.

    So, I've done some experimenting, and researching for different types of ways to Map keyboard buttons. I looked at Control X for that. Unfortunately, the control options for the player are STILL limited up to Fire 4 buttons. So I looked to see if any other extensions could work for me.

    I looked on Google for the answer, if anyone else had any similar trouble. Eventually I found this topic on the forum:
    https://community.clickteam.com/threads/87095-Remap-controls
    Last post was on 2014. However, the example MFA file that AndyBazooka posted is EXACTLY what I am looking for. The Keyboard Object used in the example seems to go beyond the 4 button fire limit, so I gave that example a quick test run. Although I have some questions and/or concerns relating to it.

    I actually made a revision/update of the users key mapping example to test controlling the player's movement.
    See attachment download below.

    Now my question are:
    - How do I detect same key presses with this? What I want to happen is if the user presses 'Arrow Up' for both up and down, I do NOT want to go to the next key map unless a new button is pressed. In other words, the key mapper should NOT proceed if the same key is pressed more than once. Likewise if the user has 'Arrow Up' for Up, then 'Left arrow' for left, then proceeded to the button for shooting or jumping, pressing 'Up Arrow' will NOT proceed. How do I do this?

    - Once these keys are set up, I've saved the key press values in the global object to stay through multiple frames. Do I need to use something like INI object, or some other file saving object so the user won't have to keep remapping the keys every time they load the game?

    - I'm kind of curious as to how this is set up. Is it possible for me to change this set up so the control config is NOT in list order? Like, when the user goes into the key config menu screen, they have to highlight a specific button they want to map first. Then they press a key to map, then go to select another key to map.
    I really like this set up in the attachment. I'm just worried there could be some complications, or it is a forced list from top to bottom to configure the controls.

    - Another thing I noticed. If you click on one of the control mappers in the list, the alterable values will get 'desynced' from what you are supposed to map. So you get awkward key mapped controls. The only thing I can think of to fix this is to set up a different key mapping script similar to this example, but which it does NOT use the list object. I tried to always lose focus, but it didn't help much. When I set the condition Always -> List Object -> Control -> Disable, that seemed to help a little, though it's probably not the best solution. The other alternate being is to have that list off screen, AND disable perhaps. If anyone else has any ideas what I can do to have this similar set up besides the list object, that would be great.

    Any help would be appreciated.
    Attached files Attached files

  2. #2
    Clicker Android Export Module

    Join Date
    Feb 2010
    Posts
    130
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Ok you're making this way too difficult for yourself... Here, I attached an MFA I whipped together in about 5 minutes. Hopefully you should be able to figure it out quite easily, if not, let me know.
    Attached files Attached files

  3. #3
    Clicker Fusion 2.5 DeveloperSWF Export Module
    N64Mario's Avatar
    Join Date
    Nov 2008
    Location
    USA
    Posts
    1,306
    Mentioned
    15 Post(s)
    Tagged
    0 Thread(s)
    I actually came on here to say that I have made another newer key control set up, but without the need of the list.
    The attached example is for my game. The only problem I have now is that the controls being set up are numbers. When a user goes to set their new keys, they won't even know what those numbers even mean.

    Is there a way I can translate these numbers into keyboard inputs without having to add an active object with over 200+ animation frames, defining each keyboard button that always sets its frame to match the current value of said input? That just seems a little tedious, so maybe there is an easier way that method.
    Attached files Attached files

  4. #4
    Clicker Android Export Module

    Join Date
    Feb 2010
    Posts
    130
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Why would you do it this way...? Uhhh... I'm pretty sure the value you get from a keyboard input is ASCII, and I'm pretty sure one of those key objects has the ability to display a string version of a key by passing it an ASCII value in the expression editor.

    I can't take a look at your MFA atm. Just to be clear are you actually tryna make an options screen where you can define your controls?

  5. #5
    Clicker

    Fusion 2.5 DeveloperFusion 2.5+ DLCAndroid Export ModuleHTML5 Export ModuleiOS Export ModuleSWF Export ModuleMac Export Module
    CapitaineCaverne's Avatar
    Join Date
    Feb 2011
    Location
    Bretigny sur Orge
    Posts
    477
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    bonjour du peu utiles l'extension Control X pour récupéré le nom de la touche ou utile une liste avec les nom des touche.
    exemple avec control x joint
    hello from the little useful Control X extension to retrieved the name of the key or useful a list with the key names.
    example with control x seal
    Attached files Attached files

  6. #6
    Clicker Fusion 2.5 DeveloperSWF Export Module
    N64Mario's Avatar
    Join Date
    Nov 2008
    Location
    USA
    Posts
    1,306
    Mentioned
    15 Post(s)
    Tagged
    0 Thread(s)
    Hmm......... Is there any way I can use my graphic font style instead? The mismatch of font styles looks really weird there. Thanks for the help though.

    Quote Originally Posted by moonyjacob View Post
    Why would you do it this way...?.........

    I can't take a look at your MFA atm........
    Really.....?

    Any way, This is the only set up I am aware of that can do more than 4 fire buttons. Since it's changing alterable values of an object, the outcome is numbers. So without mis-matching the font styles, I'm trying to convert the numbers into keyboard inputs.

  7. #7
    Clicker Fusion 2.5 DeveloperSWF Export Module
    N64Mario's Avatar
    Join Date
    Nov 2008
    Location
    USA
    Posts
    1,306
    Mentioned
    15 Post(s)
    Tagged
    0 Thread(s)
    Well anyway, this MFA is about as close as final as I'm getting to. There are a few quirks I would like to look at. Otherwise, I was able to display the key inputs off to the side using the graphical font style to match the rest of the font on screen.

    Besides some keys not being displayed like the Insert, Home, Page Up, Delete, End, Page Down keys, this was probably the best I can do. I don't know why some of those keys aren't showing up.
    Attached files Attached files

  8. #8
    Clicker Android Export Module

    Join Date
    Feb 2010
    Posts
    130
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Sorry I took a look at this thread during my lunch break.

    I'm not sure what you're trying to achieve, but I assume you're trying to allow the player to set their key controls to whatever they like. If that is the case, I would strongly recommend examining the code I attached in my first response.

  9. #9
    Clicker Fusion 2.5 DeveloperSWF Export Module
    N64Mario's Avatar
    Join Date
    Nov 2008
    Location
    USA
    Posts
    1,306
    Mentioned
    15 Post(s)
    Tagged
    0 Thread(s)
    Yea I got everything under control. But thanks though.

    The only thing I don't get is the way the keys are defined. It's kind of odd. Like, some keys are reversed, and like one key doesn't even display right. Though there is nothing I can do about this. I'm just gonna hope its a bug in the object, since my game programming script is otherwise working correctly as I want it.

  10. #10
    Clicker Android Export Module

    Join Date
    Feb 2010
    Posts
    130
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by N64Mario View Post
    Yea I got everything under control. But thanks though.

    The only thing I don't get is the way the keys are defined. It's kind of odd. Like, some keys are reversed, and like one key doesn't even display right. Though there is nothing I can do about this. I'm just gonna hope its a bug in the object, since my game programming script is otherwise working correctly as I want it.
    Are you talking about how some keys return as "none"? Yeah that's a bit of a glitch with the object, you want to return the keys as integers instead of strings. For example, in the ControlX object:
    - ` 223 "none"
    - # 222 "none"
    - ' 192 "none"
    etc

    I made the mistake of using the string unfortunately as well looks like I'll have to change it to the integers.

    And if you can't find an object that translates the integer to a string format (so that the damn thing doesn't say "none" for some keys), you may just have to define your own list. For example:

    if string == "none" then
    run some translation logic

    And that translation logic could be as simple as:

    if value == 223
    string = "Tilde"

    To make it better than a bunch of conditions though, of course you would want to be doing something like running a loop through an invisible list object off-screen to retrieve the string. Or find some other kind of dictonary lookup object, or store the strings in array :shrug: your pick. :P

Similar Threads

  1. Max clicked keyboard buttons?
    By Kentronisk in forum Fusion 2.5
    Replies: 4
    Last Post: 13th March 2015, 09:04 AM
  2. Keyboard Key mapping? plz help!
    By K_Tetsu in forum Fusion 2.5
    Replies: 7
    Last Post: 1st May 2014, 10:38 PM
  3. Keyboard corresponds to Ouya controller buttons - possible frame jump bug fix?
    By AndyUK in forum Android Export Module Version 2.0
    Replies: 15
    Last Post: 6th August 2013, 05:46 PM
  4. Another question about RPG Mapping system
    By nivram in forum Multimedia Fusion 2 - Technical Support
    Replies: 2
    Last Post: 29th August 2008, 01:19 AM
  5. Keyboard Shortcut Question
    By astrospoon in forum Multimedia Fusion 2 - Technical Support
    Replies: 3
    Last Post: 4th August 2008, 09:31 PM

Posting Permissions

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