User Tag List

Results 1 to 5 of 5

Thread: Detecting down and up states of all keys.

  1. #1
    Clickteam Fusion 2.5 DeveloperFusion 2.5+ DLCAndroid Export ModuleHTML5 Export ModuleiOS Export ModuleUniversal Windows Platform 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)
    BartekB's Avatar
    Join Date
    Aug 2013
    Posts
    654
    Mentioned
    14 Post(s)
    Tagged
    0 Thread(s)

    Detecting down and up states of all keys.

    Is there an efficient way of detecting any key when it is pressed down or released? I tried to use the Control X extension, however there is a bit of a problem with it:
    When two or more keys are pressed down at once, only one is written down when you use the "Any key" event.
    In addition, when you hold down Q, then W, then E. Releasing W will result in E being released and pressed again. The W will not be mentioned that it was released.

    If you were able to loop through each individual key that is currently pressed, it would fix this problem. But I don't think that is possible with the current events, actions and expressions of Control X.

    It would also be quite annoying writing down the keys as separate events, an estimate of 100 events :/

    Is there any other extension that helps me get around the Control X's problem?
    - BartekB, a.k.a Uppernate
    Join the Click Converse Discord! - https://discord.gg/7RNXFrC
    Dungeon Raiders! - Link soon™

  2. #2
    Forum Moderator

    Fusion 2.5 DeveloperFusion 2.5+ DLCAndroid Export ModuleHTML5 Export ModuleiOS Export ModuleUniversal Windows Platform Export ModuleSWF Export ModuleXNA Export ModuleInstall Creator Pro
    nivram's Avatar
    Join Date
    Jul 2006
    Location
    Bandon, Oregon
    Posts
    6,761
    Mentioned
    12 Post(s)
    Tagged
    0 Thread(s)
    I think there is a keyboard extension that can do that.

    Marv
    ​458 TGF to CTF 2.5+ Examples and games
    http://www.castles-of-britain.com/mmf2examples.htm

  3. #3
    Clicker

    Fusion 2.5 DeveloperFusion 2.5+ DLCAndroid Export ModuleHTML5 Export ModuleiOS Export ModuleSWF Export ModuleXNA Export ModuleUnicode Add-on
    mobichan's Avatar
    Join Date
    Oct 2007
    Location
    Buffalo, NY
    Posts
    3,310
    Mentioned
    28 Post(s)
    Tagged
    0 Thread(s)
    You could try to bind keys to flags. So if you press your "Up" key, flag 0 is turned ON. When your "UP" key is not pressed, Flag 0 is turned OFF. That way, you are just reading if Flags are ON/OFF and not testing for specific keys. This also means you will have some sort of code to define the keys that control the flags. And I would store the bound keys in alterable strings (Global Strings might be simplest).

  4. #4
    Forum Moderator

    Fusion 2.5 DeveloperFusion 2.5+ DLCAndroid Export ModuleHTML5 Export ModuleiOS Export ModuleUniversal Windows Platform Export ModuleSWF Export ModuleXNA Export ModuleInstall Creator Pro
    nivram's Avatar
    Join Date
    Jul 2006
    Location
    Bandon, Oregon
    Posts
    6,761
    Mentioned
    12 Post(s)
    Tagged
    0 Thread(s)
    Reg. That is really a good idea. I see no disadvantage in this method.

    Marv
    ​458 TGF to CTF 2.5+ Examples and games
    http://www.castles-of-britain.com/mmf2examples.htm

  5. #5
    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,501
    Mentioned
    131 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by mobichan View Post
    You could try to bind keys to flags. So if you press your "Up" key, flag 0 is turned ON. When your "UP" key is not pressed, Flag 0 is turned OFF. That way, you are just reading if Flags are ON/OFF and not testing for specific keys. This also means you will have some sort of code to define the keys that control the flags. And I would store the bound keys in alterable strings (Global Strings might be simplest).
    This should work well with ControlX's "value" system, which returns these values for the various keypresses. Polling for keys using values in ControlX is also very CPU efficient - my testing showed it to be about 10 times faster than using strings, as in the regular keyboard object.

Similar Threads

  1. Replies: 3
    Last Post: 23rd June 2015, 04:47 PM
  2. Replies: 6
    Last Post: 26th May 2015, 04:44 PM
  3. accelerator keys aka hot keys don't work
    By Gitaarheld in forum Install Creator and Patch Maker
    Replies: 1
    Last Post: 23rd February 2009, 10:05 AM
  4. Saving states when switching between frames
    By Maggott in forum Multimedia Fusion 2 - Technical Support
    Replies: 11
    Last Post: 26th September 2008, 01:18 AM
  5. Detecting the ALT keys
    By LazyCoder in forum Multimedia Fusion 2 - Technical Support
    Replies: 16
    Last Post: 8th October 2007, 09:09 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
  •