Alt key + something doesn't work. #14

Open
thehack opened this Issue Jun 25, 2010 · 20 comments

Projects

None yet

6 participants

@thehack

You can't write comments because the hash key(alt+3) doesn't work.

@steveklabnik
Hackety Hack member

Is this in the main editor, or in Try Ruby?

@thehack

It's in the main editor. Now, I have a UK layout keyboard, to achieve '#', I press alt +3.

I wonder if it's a conflict with the alt key being used for other shortcuts in Shoes?

@steveklabnik
Hackety Hack member

Ah, that might be it. I can type #s here.

I'm going to take the 'showstopper' tag off, but not because this isn't something that should eventually happen. But I don't think a lack of comments on a different keyboard layout qualifies as a showstopper. This'll eventually get fixed, but I've got bigger fish to fry at the moment.

@cesarsalazar

Hello!

I have the same problem, but I found out that it happens with all the characters that are achieved via Alt + something in some keyboards (mine is in Spanish). Some characters that I cannot write are:
@
#
{
}
[
]
\

Is it a showstopper or no? It depends on your locale. For me, it actually is a showstopper!

Happy hacking!

@steveklabnik
Hackety Hack member

ouch. That's pretty rough.

This i something we're certainly going to have to address soon.

@cesarsalazar

Let me know if I can be of any help. I can be a tester at the least.

@atestu

Same problem with a French keyboard. "|" is not working either. My little brother has a TextEdit file with the special characters… ;)

@steveklabnik
Hackety Hack member

Okay, I've been digging in over the past few days, I'll try to bump this up on my priority list.

Could anyone with this issue try this in just plain old Shoes: http://shoesrb.com/downloads

You can use this script: http://gist.github.com/656881

This'll help me figure out if this is a bug in Hackety Hack, or just Shoes.

@cesarsalazar

I just tried your script on Shoes 2 and it seems to work flawlessly.

Some keystrokes I tried:

Alt + 3 > #
Alt + 2 > @
Alt + ^ > [
Alt + + > ]
Alt + 1 > |

Thanks for jumping on this one!

@steveklabnik
Hackety Hack member

Thanks for that... so it would seem that I'm doing something funky inside the Hackety code to the keystrokes, then.

Is there a reason why you can't try this on Shoes 3?

@cesarsalazar

I can, and it also works on Shoes 3.

@steveklabnik
Hackety Hack member

Awesome, thanks. I don't think I'm going to be able to fix this bug today, but it's on the high-priority list.

What's better: I just managed to reproduce the error. Apparently it's not just foreign keyboards; hitting alt+3 on mine should give a £, and does in Shoes, but not in Hackety. Sweet.

@steveklabnik
Hackety Hack member

Okay, results of further investigation:

Basically, the problem is here: http://github.com/hacketyhack/hacketyhack/blob/master/app/ui/editor/editor.rb#L262

We're intercepting keypresses to handle the shortcuts, but unrecognized keypresses simply aren't being handled. My initial simple fix just inserts an 'alt_3' into the body, so I'm close, but not quite there...

This also raises a larger issue: what happens when a shortcut and an international keyboard collide? Hm...

@steveklabnik
Hackety Hack member

... Okay, apparently this is going to require a pretty big re-write of the editor code. So I can't promise this will come as quickly as I was going to try. :/

Still working on it, though.

@PragTob
Hackety Hack member

Hello everyone,

I can't (really) reproduce this fault. I'm using the newest hacketyhack (could you please try that?) and changed my keyboard layout to both UK Mac and the default spanish layout.

I can't add a # with Alt + 3 (for me the Alt left to my space bar), but this doesn't work in any editor I've tested (gedit and libre office writer) either. I can however add # everywhere (also hacketyhack editor) with AltGr + 3 (ALTGR is the ALT key to the right of my spacebar).

So I'd really appreciate feedback on what I might be doing wrong or if maybe it already works in the current master version.

Cheers

@thehack

I can confirm that on a mac book pro, UK keyboard, Snow Leopard, Shoes 3.0 and Hackety 1.0, there seems to be no way to acheive '#'. Alt + 3 is the default which should work - it doesn't - either does alt + shift + 3. Still a bug.

@kemenaran

I can confirm that the issue is still there in the latest master of HH (43ccd49), using Shoes 3.1. The editor won't accept any character that requires the Alt key.

Is the issue still related to unrecognized keypresses not being handled ? I'm willing to try to solve this issue ; if you have any advice on how forwarding the keypresses to the default behavior, that would be great :)

@steveklabnik
Hackety Hack member

Is the issue still related to unrecognized keypresses not being handled ?

yep, same thing.

Honestly, if you have the spare OSS cycles, helping out with the development of Shoes 4 would be the most helpful thing: http://blog.steveklabnik.com/posts/2012-05-25-shoes-4-work-is-starting--get-involved

I'm basically not working on Hackety until Shoes 4 is done, and then re-doing major parts of it. I'd love help with any and all of that.

@kemenaran

Well, to be honest I am more interested in Hackety (as a wrapper around Shoes for educational purposes) than in Shoes. However I read the posts, docs and issues on Shoes 4, and it sure looks hazardous to start improving Hackety without Shoes 4 being ready :)

That said, I am considering working on a bugfix release of Hackety ; something like fixing a few of the most visible issues (excluding the Shoes-related bugs). New users to Hackety would get a more recent code than the 1.0.1 release, with working samples, correct login to hackety.com (hopefully), and so on. And I could probably spend some time on Shoes 4 afterwards.

Does this sound like a reasonable goal, or do you think Shoes 4 is a prerequisite for anything done on Hackety?

@steveklabnik
Hackety Hack member

If you want to work on such a thing, I'd gladly release it. I just personally can't find the time to invest when I know things are changing. I have a really full plate. I'd love the help though.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment