munificent / hauberk

A web-based roguelike written in Dart.
http://munificent.github.io/hauberk/
Other
2k stars 200 forks source link

"run" does not work #19

Closed christianfriedl closed 9 years ago

christianfriedl commented 9 years ago

When I press Shift + Numpad(1..9), it just moves 1 in this direction, the same as without Shift.

munificent commented 9 years ago

Bummer! :(

What browser, OS, etc. are you running on? Do you have NumLock on?

christianfriedl commented 9 years ago

Hi,

oh, sorry, forgot the technical details. Win7, Chrome 39.0.2171.95 m.

Maybe I'm just misunderstanding the whole system. It's a bit hard, with the round-based logic, to determine whether running should move more than 1 spot or not.

But my impression is that Shift + DownArrow sometimes does run, while Shift

NumLock is definitely on, and "normal" movement works on the NumPad.

Well and also, looking at main.dart, I don't see any bindings for KeyCode.NUMPAD_ with "shift: true", so...

Awesome work, man! I already infected a friend with Hauberkitis. :-) Plus, I bought your book!

Cheers, Christian

2015-01-15 0:53 GMT+01:00 Bob Nystrom notifications@github.com:

Bummer! :(

What browser, OS, etc. are you running on? Do you have NumLock on?

— Reply to this email directly or view it on GitHub https://github.com/munificent/hauberk/issues/19#issuecomment-70016545.

munificent commented 9 years ago

Oh yeah, how did I miss that?

Can you try it now? It should be fixed.

christianfriedl commented 9 years ago

Hi,

well, it goes to show you're only a puny human and lowly coder, just like myself. ;-)

Hmm, it works way better than before...

n/s/w/e work with numlock-off (run and move). running only works with numlock-off. nw/sw/ne/se only work with numlock-on, but running still doesn't work.

Odd. Very odd indeed. As far as I understand the code, it should be working. Hmm.

Oh, and I forgot to mention, it's a german keyboard. That shouldn't affect the numpad, though.

2015-01-15 16:01 GMT+01:00 Bob Nystrom notifications@github.com:

Oh yeah, how did I miss that?

Can you try it now? It should be fixed.

— Reply to this email directly or view it on GitHub https://github.com/munificent/hauberk/issues/19#issuecomment-70097872.

munificent commented 9 years ago

well, it goes to show you're only a puny human and lowly coder, just like myself. ;-)

I'm certainly that!

n/s/w/e work with numlock-off (run and move). running only works with numlock-off. nw/sw/ne/se only work with numlock-on, but running still doesn't work.

Weird! I develop on a laptop, so I don't even have a numpad—much less a German one—which makes it hard for me to repro stuff like this. If you'd like to be a lowly Hauberk coder, I would certainly love to have you try to get the source running locally on your machine and see if you can figure out a fix.

jtuu commented 6 years ago

I know this is old and closed, but this issue still exists and I know what the cause is but I'm not sure what the best way to fix it would be. The problem is that when Shift+AnyNumpadKey is pressed while numlock is on the keypress is modified to what it would be if numlock was off. This is an OS feature (and it can't be easily disabled on Windows).

Example:

The fact that shiftKey is reported as false by browsers is weird and makes it difficult to work around this issue. I get this behaviour on Firefox and Chrome on Windows 7.

Anyway, I just wanted to shed some light on this issue, but I don't have any solutions.