[Plugin] Keycode

  • SullyTheStrange,

    Yeah I know it would be LONG!!! But its something you'll have to do if you really want it in your game <img src="smileys/smiley1.gif" border="0" align="middle" />. I might do this in mine aswell. But i'll leave it to a last min thing cause its going to make me hate my life <img src="smileys/smiley17.gif" border="0" align="middle" />

    Why dont you ask Ashley if he can implement this into C2 somehow?

  • this is a great plugin for direct access to keyboardinput, really need something like this, i was planning on using it for direct output to text element, so its really a shame it doesnt work in chrome, would be great if it could be integrated in official keyboard plugin

  • Wait, how do you use this to create custom controls? From what I saw it only have the equivalent of the "on key pressed" and no "key is down"

  • this plugin can capture every keyboard input, its no trigger, you would put the pressed key into a variable and with that you could make custom controls

  • That's exactly what I did:

    Global variable keyLeft = 37 (means left arrow)

    Start of layout: start capture

    Keycode.ScanCode = keyLeft: go left

    It works, but the object keeps going left forever, because the Keycode.ScanCode only changes once I press another key

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • i dont think this plugin will work for what you want to do, it only captures the key, like you said it doesnt account for the different keysstatus

    the construct keysetting should be by variable, then this capturing of keystrokes could be used to replace these variables.

    but it would also be usefull for textgames en direct textinput without inputfield.

  • but it would also be usefull for textgames en direct textinput without inputfield. This was my primary reason for creating this plug-in in the first place. At the time, there was limited support for text entry. I was also looking at a way to be able to set custom key mappings, e.g. allow the player to reset movement from WASD to something else, in game. This would then allow the constructor to set a variable, and check that variable using the built-in keyboard functions. It was never meant to replace movement using the keyboard plug-in.

    Since then, new features/plug-ins have been introduced which pretty much address these issues. I still think this plug-in might be useful in some situations, but it does not interact well with the keyboard plug-in. The keyboard plug-in basically overrides the keycode functionality.

    IMO, the best option would be for Ashley to include the keycode functionality in the keyboard plug-in, when he has time, and if the need still exists.

  • Wastrel, what new features/plug-ins are you talking about in the above post? I've been busy with work for the past few months so I haven't kept up with C2 updates, and now that I'm getting back to my game, I think the keycode plug-in isn't working correctly anymore. <img src="smileys/smiley6.gif" border="0" align="middle" />

  • Yeah I'd love it if Ashley could just add this to the official keyboard one. Since the conflict between this and the keyboard plugin makes it useless. :(

  • alspal, I agree.

  • Sorry to resurrect an old post, but I've revisited the KeyCode plug-in after learning a lot more about JavaScript.

    I've finally found where the issue lies between the KeyCode plug-in and the native Keyboard plug-in. The Keyboard plug-in calls the preventDefault method at the end of the onKeyDown and onKeyUp functions. This basically short-circuits any other keyboard events which follow.

    Ashley, is there any type of workaround that I can include in the KeyCode plug-in that will ignore the preventDefault call?

    If not, I'm afraid the KeyCode plug-in is useless, when used in conjunction the Keyboard plug-in.

    Thanks!

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)