User Tag List

Results 1 to 7 of 7

Thread: Customizable Controls - Detect if key is used twice?

  1. #1
    Clicker Fusion 2.5 DeveloperFusion 2.5+ DLCAndroid Export ModuleHTML5 Export ModuleiOS Export ModuleXNA Export ModuleInstall Creator Pro
    Fusion 2.5 (Steam)Fusion 2.5 Developer (Steam)Android Export Module (Steam)HTML5 Export Module (Steam)iOS Export Module (Steam)Universal Windows Platform Export Module (Steam)
    piscesdreams's Avatar
    Join Date
    Dec 2007
    Location
    United States
    Posts
    928
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)

    Customizable Controls - Detect if key is used twice?

    Hello all,

    Maybe it's just been a long day, but I am having a total brain fart. I use the Control X and Joystick 2 objects for controls and am setting up keybindings. What is the best way to detect if a key is already used?

    For example, I have global values dedicated to the jump button for keyboard, attack button for keyboard, jump button for gamepad, attack button for gamepad, etc. I'm trying to allow the player to setup whatever button they want individually and am at a loss on how to detect if they have already used a button - and if so, make the new button take precedence. Such as if "A" is set to Jump, and "X" is set to Attack, and the player tries to set "X" as Jump, I'd want it to swap the buttons.

    Thanks!

  2. #2
    Clicker Fusion 2.5 (Steam)Fusion 2.5 Developer (Steam)Fusion 2.5+ DLC (Steam)Android Export Module (Steam)HTML5 Export Module (Steam)iOS Export Module (Steam)Universal Windows Platform Export Module (Steam)
    Volnaiskra's Avatar
    Join Date
    Jan 2014
    Location
    www.sprykegame.com
    Posts
    2,297
    Mentioned
    94 Post(s)
    Tagged
    0 Thread(s)
    I would probably create a new active object with each control (jump, attack, etc.) assigned to a different alterable value. Then when the user chose her desired key (I would use ControlX's value mode rather than string mode), I would execute a fastloop that went through each alterable of that object (using loopindex to search through each alterable value by its index) and compared the user's selection with the stored selection. Does that make sense?

  3. #3
    Clicker Fusion 2.5 Developer
    Fusion 2.5 (Steam)Fusion 2.5 Developer (Steam)Fusion 2.5+ DLC (Steam)Android Export Module (Steam)HTML5 Export Module (Steam)iOS Export Module (Steam)
    J3sseM's Avatar
    Join Date
    Feb 2013
    Location
    Finland
    Posts
    868
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    I'm currently creating key bindings myself.

    I'm simply using "Any key is pressed" and in the same event I negate "Value "1" is pressed" for all bindable key slots, so it checks what keys are currently in use. This way it won't allow using keys that are already in use.

    By the way, I'm struggling to make my system unicode - Control X is not unicode, in fact, I don't think there is a unicode extension for this. I'd need to fetch "last key pressed" unicode.
    Also, super confused about Chinese keyboards, what happens when they press "D", how is it recognized? Changing keyboard to Chinese doesn't work at all I'm afraid.

    Sorry to hijack your thread mate!

  4. #4
    Clicker Fusion 2.5 DeveloperFusion 2.5+ DLCAndroid Export ModuleHTML5 Export ModuleiOS Export ModuleXNA Export ModuleInstall Creator Pro
    Fusion 2.5 (Steam)Fusion 2.5 Developer (Steam)Android Export Module (Steam)HTML5 Export Module (Steam)iOS Export Module (Steam)Universal Windows Platform Export Module (Steam)
    piscesdreams's Avatar
    Join Date
    Dec 2007
    Location
    United States
    Posts
    928
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    Hi fellas. Thanks for your ideas!

    Volnaiskra: That makes sense. I had set it up with their own image for each key, but it does make sense to use one sprite and include all images there and loop through that way. I don't know why I took the route I did.

    J3sseM: The way I did my keyboard keybindings is I just added conditions that Global Value "Jump Button", Global Value "Attack Button" (and so on for all keys) <> last key pressed. It's crude but it worked for that. I haven't paid much attention to whether something is Unicode or not. Perhaps I should though. I couldn't even start to comment on Chinese keyboards though. I know nothing about it. Haha.

  5. #5
    Clicker Fusion 2.5 Developer
    Fusion 2.5 (Steam)Fusion 2.5 Developer (Steam)Fusion 2.5+ DLC (Steam)Android Export Module (Steam)HTML5 Export Module (Steam)iOS Export Module (Steam)
    J3sseM's Avatar
    Join Date
    Feb 2013
    Location
    Finland
    Posts
    868
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    Hehe, well using Control X you get "none" if you hit for example ─. However, "basic characters" should work. So if user in China presses "D" it's still "D" apparently, so this is good.
    Or in Russia, it's "В" but recognized "D", so it should work. Just can't bind anything to those "foreign" buttons like ─,┼,Í in Finland.

  6. #6
    Clicker Fusion 2.5 DeveloperFusion 2.5+ DLCAndroid Export ModuleHTML5 Export ModuleiOS Export ModuleXNA Export ModuleInstall Creator Pro
    Fusion 2.5 (Steam)Fusion 2.5 Developer (Steam)Android Export Module (Steam)HTML5 Export Module (Steam)iOS Export Module (Steam)Universal Windows Platform Export Module (Steam)
    piscesdreams's Avatar
    Join Date
    Dec 2007
    Location
    United States
    Posts
    928
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    Interesting. That will certainly make localization much more difficult... I would have thought it just read the value of the key but I guess keyboards are different in other countries.

  7. #7
    Clicker Fusion 2.5 Developer
    Fusion 2.5 (Steam)Fusion 2.5 Developer (Steam)Fusion 2.5+ DLC (Steam)Android Export Module (Steam)HTML5 Export Module (Steam)iOS Export Module (Steam)
    J3sseM's Avatar
    Join Date
    Feb 2013
    Location
    Finland
    Posts
    868
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    I don't know how this would affect localization other than key input name which is no biggie.

    Figured my Russian example was a bit confusing, it's not that "B" is "D", but Russian Cyrillic "В". For example "A" would be "Ф" I think. Anyway, so if Russian user clicks "Ф" from their keyboard it should show "A" instead if that makes sense.

Similar Threads

  1. Detect a swipe over system controls?
    By macca02 in forum Android Export Module 2.5
    Replies: 0
    Last Post: 13th February 2014, 03:32 AM
  2. Customizable Animation Seqences ?
    By Pyrasia in forum Multimedia Fusion 2 - Technical Support
    Replies: 6
    Last Post: 22nd February 2009, 05:00 PM
  3. Customizable Pause Screen
    By dsmathewson in forum Multimedia Fusion 2 - Technical Support
    Replies: 3
    Last Post: 25th November 2008, 05:33 PM
  4. Customizable map size
    By waffles in forum Multimedia Fusion 2 - Technical Support
    Replies: 2
    Last Post: 9th August 2006, 10:29 AM

Posting Permissions

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