Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

iPhone fail #2

Open
jakeasmith opened this issue Apr 1, 2010 · 7 comments
Open

iPhone fail #2

jakeasmith opened this issue Apr 1, 2010 · 7 comments
Labels

Comments

@jakeasmith
Copy link

If you're viewing this from an iPhone, there is absolutely no way to access the keyboard to type in the cli. Wonderfully annoying :(

@chromakode
Copy link
Owner

It's unfortunate. I'm not sure how to fix it on embedded browsers, though one thing I'm working on implementing is making printed commands clickable -- so that at least you'll be able to use the next/prev/first/last on the page.

@mwarrenus
Copy link

For iPhones, would creating a form input field and then forcing focus there get the onscreen keyboard to pop-up and allow keystroke capture from javascript?

@chromakode
Copy link
Owner

Yeah, I'm afraid that may be the way to do it. The original CLI2 code this is based on (which I've extensively changed) used an input field as well as event handlers to process input. I wanted to move away from this, but it seems that without an input field, embedded browsers have no way of knowing there's something to type in.

I haven't had the time to research whether there's an alternative (a way to tell the browsers you're accepting input?) or a better approach. Is this something you'd be interested in doing?

@mwarrenus
Copy link

One workaround is to select some text first at the top of unixkcd (on my Palm Pre this is done by holding the shift key and then tapping to select some text). The text selection moves the input focus out of the URL bar and onto the page content. Key events are then delivered to the .keypress handlers and things mostly work. The Sym key even works as a Ctrl modifier in unixkcd, however, arrow keys, pgup, pgdn and other special keys are not available on the Pre keyboard which makes entering the konami code a mystery. For iPhones, however, the onscreen keyboard will still probably be hidden.

@mcfarland-ubc-library
Copy link

@chromakode when I wrote it originally there wasn't a jQuery (or maybe there was? This was 2006 or so but I wasn't aware of it), so I just fumbled around until I got what I wanted, and that turned out to be a hidden textarea with an event listener and everything refocusing on the textarea on an event. And then there was the jQuery, which you converted it to, and even if I never got great fame or even a handshake from Randall, that was pretty great as far as impressing certain sorts of people, because I could say "just check out the very bottom of the uni.xkcd site if you need my cred". It's not a straight line, but my job now is not completely unrelated.

But I think even at that point I was arguing with all the various browsers about keycodes, and each browser/OS changing the damn keycodes pretty much randomly, and untrappable combinations, even with the textarea hack. Users just notice that Ctrl-H doesn't backspace anymore, suddenly it now opens up the History tab which they weren't even aware of, and why the hell did I make it do that. I had promised a Bash shell in the browser, and I should deliver, or I should get a huge FAIL stamp if I can't. And yeah, I got stamped. Should have known, really, I apparently knew about the encroaching ctrl-key takeover even then, because I did make the Scroll-lock hack (to make sticky modifier keys), even if nobody noticed. Really they shouldn't have; sticky modifiers was a Windows thing.

But you know, it's pretty easy to say "iPhone fail" like a dumbass, @jakeasmith . You might have improved since this bug report was entered, but even after all these years, Apple folk are still the most self-entitled twats.

Anyway. Between Wordpress changing weekly and browser devs doing whatever the hell, it became apparent that the idea of making anything half resembling a command line was going to be doomed.

@chromakode
Copy link
Owner

@mcfarland-ubc-library Gosh, what's old is new again. Isn't it funny that after 8 years, and with the benefit of hindsight, the best way to ensure mobile browsers do the right thing w/ soft keyboards is still the textarea/input focus technique your original CLI2 used? 😂

But seriously, I can't thank you enough for your contributions to this project -- your Wordpress theme was so mindblowingly memorable that when I heard the idea to build unixkcd, I remembered your implementation and because of it knew that making a convincing bash shell would be possible. I can say with certainty my job wouldn't be the same without this project or your original work on it. ❤️

At the time, the mass of domain knowledge required to make sense of cross browser input events in vanilla JS was way beyond my in-browser JS expertise, so I reached to jQuery as (like most people did) an abstraction to remove some of that doubt. In the process, the codebase lost the hidden input trick which remains essential to mobile web UX to this day.

As an aside... 2010 was a different era in etiquette around open source project discussions. At the time, as a 19 year old without access to a smartphone it was useful knowledge that the codebase didn't work on iPhones, even though I didn't have a chance of iterating on a fix. @jakeasmith -- I'd say 8 years is past the statute of limitations for saying something silly on the internet, and I don't fault you for the tone of an ancient comment. 🙃

@jakeasmith
Copy link
Author

Ha. Well, that happened. I’m probably still a self-entitled twat - I do like my Apple products, after all - but hey, at least I’m not trolling comments from eight years ago and calling people silly names 😆

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants