User Tag List

Results 1 to 2 of 2

Thread: Arrows keys used for movement move whole page as well

  1. #1
    Clicker

    Fusion 2.5 (Steam)Fusion 2.5 Developer (Steam)Android Export Module (Steam)HTML5 Export Module (Steam)iOS Export Module (Steam)
    Melubnio's Avatar
    Join Date
    Mar 2016
    Posts
    14
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Arrows keys used for movement move whole page as well

    Hi there,

    When I use the arrows keys to play my game in HTML, the whole page moves as well and this is so annoying. Can anyone help me?

    Thank you in advice,
    Daniel

  2. #2
    Clicker Fusion 2.5
    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)
    tk22's Avatar
    Join Date
    Dec 2014
    Posts
    64
    Mentioned
    5 Post(s)
    Tagged
    0 Thread(s)
    The way I did it is by editing the "Runtime.js" file under the "src" folder and adding this block of code to it at the bottom then saving the changes:

    window.addEventListener("keydown", function(e) {
    // space and arrow keys
    if([32, 37, 38, 39, 40].indexOf(e.keyCode) > -1) {
    e.preventDefault();
    }
    }, false);


    you can see it in action here: Link

    if anyone knows a better method let us know!

Similar Threads

  1. Removing arrow keys to move
    By zitubia in forum The Games Factory 2 - Technical Support
    Replies: 3
    Last Post: 13th December 2011, 05:27 AM
  2. Multiple keys (arrows) block
    By KaiseanGames in forum Multimedia Fusion 2 - Technical Support
    Replies: 2
    Last Post: 28th January 2011, 05:33 PM
  3. Use A, W, S, D Keys For Eight Direction Movement
    By drnebula in forum Multimedia Fusion 2 - Technical Support
    Replies: 7
    Last Post: 5th June 2010, 12:24 AM
  4. Changing the Movement Keys
    By algiz in forum Multimedia Fusion 2 - Technical Support
    Replies: 2
    Last Post: 17th June 2009, 02:27 PM
  5. special movement, arrows move mouse aim
    By Oreo in forum Extension Development
    Replies: 3
    Last Post: 14th April 2008, 12:06 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
  •