Open pirrate opened 9 years ago
Could you give more details? Crash log, etc. I just tested the master branch on the iPad Simulator and it doesn't crash.
Also, does it crash on your Simulator or only on device?
Only in device. Please test in real device. I have tested with 2 different devices. Same result.
I don't have a device to test on at the moment. I would appreciate it if you could post the crash log, as well as the exact place where it crashes. (I think this will be more accurate if you run in Debug mode rather than Release.)
Not able to get logs/debug now. Laptop is at home. And i always tested with simulator too. Sad thing is i dont have iPad (( I sent bundle to my friends they did test and got crash.
That's weird...
Well, if you get your hands on the crash logs, let me know. I'll keep an eye out for it.
I have been playing with this on an iPad, and it works for me in both portrait and landscape mode, BUT, if I change orientation, it crashes. If I have a debugger connected, it says: Message from debugger: Terminated due to Memory Error
.
That is exactly what is happening on my test users. If you noticed you can not type anything on landscape mode too. If you click any button it crashes. Does it same for you?
No, pressing buttons works for me, however I have been testing with my fork so I may have fixed another issue that causes that.
yeah, in my case it is not possible to press any button on landscape mode. it crashes immediately. Also yes it crashes when i change orientation from Portrait to Landscape. I am using master of this project.
OK, I see what's causing the problem. It looks like memory usage on an iPad is 3x that of the iPhone for some reason. When you rotate, it goes from 30-something MB to 40-something, which is probably what causes the crash. I will try to fix. In the meantime, check the "key-reuse" branch that I just added — does it still crash there? (The branch is still incomplete.)
Yikes, I'm checking with Instruments and there's some really heavy allocation going on during repeated key presses and mode switching.
key reuse looks cool. works extremely faster. but i still able to increase memory when keep changing keyboards (ok lets hope it is dev tool bug). bbqsrc could you please check if it still crashed on iPad? i dont have have ipad so can
t test it :(
Any idea what and why causing heavy allocations?
I think it's the fact that I have 3 CALayers and a UILabel for each key.
For iPhone keys, I'm seeing a 32kb allocation per layer. (Makes sense: (26 * 2) * (39 * 2) * 4 bytes for RGBA + whatever other stuff CALayer has is in the ballpark of 16kb-32kb.) 32 * 26 (approx keys per page) * 3 *4 = almost 10MB! And iPad keys have almost 8x the area.
I will probably try to condense the three layers into one.
Incidentally, commenting out self.layer.shouldRasterize = true
in KeyboardKey improves memory 2x, since I guess it doesn't actually keep buffers for all the keys. But this impacts responsiveness, so YMMV. (Also, I think it builds back up over time, as the keyboard is used.)
interesting article in here http://chaosinmotion.com/blog/?p=855
I've tested with the key-reuse
branch and it no longer crashes. I'll be using this as my master
in the mean time. :smile:
It does however crash if you type some keys (10 or more) when in landscape for me.
Heh, also, if you type really really fast, you can see the keys you pressed played back to you because it is sequentially drawing each key press and it isn't fast enough.
HERE THERE BE DRAGONS
(it's not done yet)
Oh, I think you can fix the landscape crash and maybe the key ghosting by changing the setMode(0)
calls in keyPressedHelper
to self.currentMode = 0
. Maybe.
You were right, that does fix it. And yes, I know there's dragons, but I did review the code first. I know what I'm getting myself into. :+1:
@archagon: been playing some more. If you enable "Allow Lowercase Key Caps" and use the keyboard in landscape mode, it will still crash unfortunately.
Also, hitting shift in general causes it to crash in a disappointed way. Mash some keys, where one of them is shift, it'll die.
Also it sometimes crashes when you use keyboard often and type really fast on iPhone. Wasn`t able to check it with this version but in previous master it was crashing.
Kept testing key-reuse branch today. On iPhone seems like it works fine but on iPad still have problem on landscape mode. Different kind of strange crashes happens. Well, all of them because of memory for sure. 1) Crashes when i hit enter button 2) Crashes when i hit ?123 (char keyboard) button 3) if i type long text then keep holding backspace to remove, it crashes somewhere, in my case it always crashed on the last character remove.
That is it for now.
Thanks! Working on it.
I think the latest commit to key-reuse should improve memory usage significantly. (But it's hard to tell, all the Instruments have different readings for memory usage!) Still need to fix the shift key memory spike, though.
And the one after that should fix a lot of the problems with shift and mode switching.
Works gorgeous now. trying to mess up with iPad but i am not succeeded :)) That means keyboard will fly on iPhone. Last fixes are really cool!
@archagon: well done!
I now have a fun issue though on my fork, which is best explained with the following screenshot:
Only one of the shift buttons draws the icon now. If I change pages and come back, the button that gets drawn shifts! :laughing:
So I looked closer at the code, and getShape
already has a TODO listing this as a known issue. :stuck_out_tongue_closed_eyes:
Hey @bbqsrc how did you make the top of the keyboard to appear like that. Please help here.
@jermiy: look at my fork. Of particular interest will be the GiellaKeyboard.swift
file.
@bbqsrc thank you very much for fast help. these are the screen shot i have that it wasn't properly indented. I don't know if thats the right word though. the first pic is @archagon version and it was perfect and the second one is the one you sent me
and i thank you again.
@jermiy: I just noticed I had issues disabled on my fork. If you could delete your comment above and post it on my fork (so we don't annoy @archagon), that'd be great.
Wait up, I'm leaving this open until I merge the branch.
just checked the latest merged code , still having the same issue as bbqsrc specified. If we add two Shift buttons, Only one of the shift buttons draws the icon now.
Keyboard still lagging when you type fast on iPad. So it is not possible to write fast and correct. Will really appreciate if you fix that.
What iPad do you have? I have an iPad 3 and all my keyboards are laggy at this point, to be honest.
i use iPad 2. Sometimes it is event changing to other keyboard automatically. it still have performance issues.
Keyboard crashes on iPad landscape mode. It appears normally but whenever you click any button it crashes. I tested in real device. Urgent fix appreciated.