iOS AudioKit using `AKKeyboardView` - ios

The question is very simple. Is it possible to programmatically send a note on/off so it will show on the keyboard view? What I'm trying to do is link the AKMIDICallbackInstrument to the keyboard.
There was an article about doing something similar but it doesn't seem to be possible. (Thinking about it, the keyboard delegate should be the one handling keyboard view touch events, not the other way around...) Also checked the AKKeyboardView code, but it seems like there are only touch related code.
If there is no such method, are there plans to add them?

Two methods have been added to AKKeyboardView on the develop branch of AudioKit:
programmaticNoteOn(_ note: MIDINoteNumber)
programmaticNoteOff(_ note: MIDINoteNumber)
These allow you to programmatically simulate key presses and key releases without calling the delegate.

Related

How to capture iOS on-screen keyboard key press and key release events

Apple has recently provided a way to handle keydown and keyup events from keys typed on an external keyboard; see here. In this new API, one must override pressesBegan and pressesEnded functions, which provide event-related information, including the key pressed (or released) by the user.
I was wondering if there is anything similar to this when using the on-screen keyboards. I tried to implement these functions, but they will only be triggered when the device is hooked up to an external keyboard. Nothing happens when using on-screen keyboards though.
Have you guys heard of any alternative?
Thanks.

iOS keylogger for jailbroken devices

I want to know how to implement a keylogger for iOS jailbroken iPhones and prevent being logged by others.
1. Implementing a keylogger in iOS (jailbreak)
I have thought of two ways to do this,
First way:
I hook _endedEditing method of class UITextField and save the text of the textfield somewhere. The advantage of this way is it's easy and it's not depending on what you typed. So if you have copied some text in the textfield, you would know that too. The problem is It's not called for text boxes in html webpages like google search bar or some programs that there keyboard doesn't hide.
Second way:
I should hook the keyboard buttons press method and save there labels. The keystrokes should be slit every time the keyboard hides. There is a problem here for me: First of all I can't find the right method of the right class to hook. I've found UIKeyboardButton that inherits from UIButton but when I hook any method of that it's not called, I don't know why!
So how can I implement a keylogger for iOS?
2. Preventing an app being keylogged by a third party app/tweak
Now the second part of my question; There is a keylogger in cydia named iKeyMonitor that logs keystrokes and it's good at its job. The suprising thing here is that it can't log whatever is typed in iFile app! I even have tested this with the first way I mentioned above and I can't receive any text when I type anything in iFile. How does iFile do this and how can we do the same thing for our app?

The Correct Way to do Custom Keyboards in iOS?

I am looking to implement a custom toolbar that sits above my keyboard for a text field with some custom values. I've found a ton of tutorials online but this question is for asking what's the best way to do this.
This tutorial here http://blog.carbonfive.com/2012/03/12/customizing-the-ios-keyboard/ provides the most common way I can see across many tutorials, with creating a new subclass of UIView and using delegates to get that information across.
That's the commonality. However, I came across this tutorial which in the view controller itself just creates the toolbar, assigns it to the textField inputAccessory and it's good to go. In fact, I tried out the code and without any effort, I have now a custom keyboard.
http://easyplace.wordpress.com/2013/03/29/adding-custom-buttons-to-ios-keyboard/
This just seems a bit too easy to me though and I'd think the proper, Apple recommended way would be to create that UIView subclass and use delegates so that the view controller with the text fields acts as that delegate.
I'm specifically targeting iOS 7 in my app.
What are people's thoughts on this? If the second easier link is supported and is likely to pass Apple's guidelines, it's a good starting point but if delegates are the way to go, I'd rather look into that from the start.
Your thoughts will be appreciated.
There is no 'Apple Approved' way to do this, and its hard to believe anything you do here would get your app rejected. The custom keyboard you reference in your post has the iOS6 look and will appear outdated in an iOS6 app. I'll mention some iOS7 suggestions shortly, but the constant danger of mimicking what the System looks like today is guaranteed to look outdated later. In Mac/Cocoa development, Apple use to say at the WWDC that if you did something custom, make it look custom, don't take a standard Apple widget and try to duplicate it. But that advice is mostly ignored.
For iOS 7, you can create buttons that appear just like the system ones do (not pressed), but of course when someone presses them, they won't act like system buttons (i.e. animate up and "balloon" out.
I'm currently using a fantastic add-on keyboard, my fork of KOKeyboard (which uses the buttons above). This is such a cool addition. While the buttons look like iPad buttons, each one has 5 keys in it. By dragging to a corner you select one of the four, and tapping in the middle gives you that key. This might be overkill for your app, but it really helped me with mine. It looks like this:
(the Key / Value is in the under laying view.) The center control lets you move the cursor - its like a joy stick - and can be used to both move and select text. Amazing class, I wish I'd invented it!
Also, for any solution, you want to use a UIToolbar as the view holding the keys, for the reason that it supports blur of the view it overlays, just like the keyboard does. You can use the UIToolbar with no bar button items in it (if you want), and just add subviews. This is a "trick" I learned here, as there is no other way to get blur!
David's KOKeyboard (er…, the one he used - see David's comment below) looks nice. I suspect that he is using the official Apple mechanism:
inputAccessoryView
Typically, you'd set that value on a UITextView, but it can be any class that allows itself to become the first responder.
The provided view will be placed above the default apple keyboard.
It is correct that there is no official mechanism (and it is suggested against) to modify any system provided keyboard. You can add to it, as above. You can also entirely replace it for with your own mechanism. Apply will forgo the keyboard setting on your view and use a custom input mechanism if you set
inputView
set it to any view - Apple will still manage its appearance and dismissal as it does the custom keyboards.
Edit: Of course, iOS 8.x added significant access to keyboards. (not mentioned here)

iOS: Facebook chat heads behaviour and animations

This question is probably a little out of date, but I've been using the new Facebook for iOS with the "chat heads" feature (with the chat heads only present within the app), and was wondering how Facebook went about implementing this? E.g. How did they handle the drag animations for the chat heads, and also (when clicking on the chat head) how did they manage to overlay a UITableView on top of the "base" UIViews in the background?
Is this all part of UIKit, or did they create their own classes to handle this?
To answer #StuartM's question in the comments, in the last couple of months I've had a bit more experience with UIKit, and I think I have a rough idea on how I would implement something like this if I was going to do it.
What I would do is for the chat head, create a styled UIButton and add it as subview to the main Window. For the dragging, I would add a Gesture Recognizer to the UIButton to respond to the drags, and for the "snapping to edges" I would use iOS 7's new UIKit Dynamics (http://www.raywenderlich.com/50197/uikit-dynamics-tutorial).
As for showing the UITableView overlay with the chat history, I would use a Child View Controller (https://developer.apple.com/library/ios/featuredarticles/ViewControllerPGforiPhoneOS/CreatingCustomContainerViewControllers/CreatingCustomContainerViewControllers.html#//apple_ref/doc/uid/TP40007457-CH18-SW6) and as for the popping open animation, I would just use the default UIView animations, maybe using animation transactions as I'm not sure I can do everything with just the implicit animations?
And I think that should be it. To be honest, I think anyone who has a handle on those frameworks should be able to build anything in their iOS apps, and if you were to create a "chat heads" like sample project in your spare time, should give you a pretty indepth knowledge of how those frameworks work.

Build custom iOS control which takes keyboard input

I'd like to build a custom iOS control which can take keyboard events from a physically keyboard connected to an iPad. I'd rather not subclass or otherwise make use of any of the existing high level UIKit classes but would rather receive and process the low level keyboard events themselves.
Is this even possible with an iOS app?
Unless you are going to implement your own keyboard (not recommended - it's wrong on so many levels including internationalisation/foreign language support), you'll need to either use an instance of UITextField or UITextView or subclass one of these classes. AFAIK (and I've looked into it in some depth) there is no other way to trigger the on-screen keyboard in iOS.
You might try looking in the ExternalAccessory framework - maybe you could find an open source implementation of the USB keyboard interface and put that to work.

Resources