haxegon / zeedonk

Haxegon + Puzzlescript = Zeedonk!
http://www.zeedonk.net
12 stars 2 forks source link

Key.minus not detected on firefox on windows or osx #160

Open increpare opened 9 years ago

increpare commented 9 years ago
function new(){
}
function update(){
  if (Input.justpressed(Key.MINUS)){
    Debug.log("MINUS");
  }
  if (Input.justpressed(Key.A)){
    Debug.log("A");
  }

}
increpare commented 9 years ago

on firefox on my laptop, - has the keycode of 173 - but I think you're checking for 49

I don't know if hyphen has a different keycode for the numpad

OH WAIT MINUS IS ONLY 173 ON MAC WITH FIREFOX ON SOME BROWSERS. WELL THAT'S SURE NICE.

https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent/keyCode

apparently keycode isn't recommended anymore to check against. There's a "code" member, which returns useful things (like "KeyA"), but would return = instead of +, and a "charCode", but that doesn't seem to work for symbols.

More research needed.

increpare commented 9 years ago

a quick hack would be to link minus to keycode 173 as well. Can we do that?

increpare commented 9 years ago

new openfl might deal with this (probably doesn't).

increpare commented 9 years ago

check out pico-8 handles this