I realize that iOS has the ability to have keyboard shortcuts (e.g.: Command-C for Copy, Command-V for Paste, etc). But is there a way to make your own keyboard shortcuts? Is there a way to implement them? I would like to know so that I can add them to some of my note-taking apps in the near-future. Thanks! :)
You'll need to modify a UIMenuController if you want to have your implementation blend in with the apple UI (It's always best to comply with the HIG!). Here's the class reference, and a nice tutorial.
Related
The title pretty much sums it up. But, basically is it possible with Adobe applications to add event listeners to in-application items, such as a pathItem in Illustrator?
So I want something to happen when I click on a pathItem in Illustrator - or something like that. Is this possible?
I'm afraid I know the answer.
Sorry. That is not possible with scripting. Maybe with a plugin.
You can use Scriptographer, it's a scripting plugin for Illustrator with own scripting engine with keyboard and mouse events.
But this plugin works with old illustrator's version (CS5 and older).
wouldn't this work to handle the click/selection event?
AIEventAdapter.getInstance().addEventListener(AIEvent.ART_SELECTION_CHANGED,function(event) {});
If you are talking about exported PDF's or SVG's, you are able to add a link in the attributes panel and insert any javascript you like:
javascript:alert('you clicked on this line');
If you want something to happen in Illustrator, while you are using the program, then there is no way as far as I know to affect anything.
You can run scripts using keyboard shortcuts.
If you could clarify your use case I might be able to help more.
This may be really simple, since I can't use window.getSelection on iPhone Safari, I was wondering if I could put the selection in the clipboard and use a bookmarklet to send it to Drafts (among with location.href)
The first part of the equation is quite simple:
javascript:window.location='drafts://x-callback-url/create?text='+encodeURIComponent(location.href+'%5Cn%5Cn')
As I'm a rookie, I interpreter this "create a new document in Drafts and append the current window link to the top and press return twice", now I just need to add the contents from the clipboard into this.
If I simply use the Drafts short [[clipboard]]to add the clipboard, it won't work. So I'm suspicious that I'll need a Java solution. Ideas?
unfortunately, it seems like, according to the state of things as they are right now, this is impossible. I'm better off with the clipboard in the iPhone, it seems. Thank you for checking out.
The command I was looking for is available in the iPad, you can reach it through this:
javascript:window.location='drafts://x-callback-url/create?text='+encodeURIComponent(location.href+'%5Cn%5Cn')+encodeURIComponent(window.getSelection())
According to the article by Federico Viticci, this encodeURIComponent(window.getSelection()) being the snippet that grabs the actual selection.
This happens because when you open the bookmarks tab in the iPhone, it deselects your selection and the snippet becomes useless. In the iPad, you must keep the Always Show Bookmarks option on.
The latest version of iCab Mobile has a variety of gestures, a draw-gesture feature, and a bookmarklet list called "Modules" that is (unofficially) customizable. On both the iPad and the iPhone, gesture recognition can execute JavaScript or launch apps by URL scheme without affecting your selection. It also happens to support x-callback-URL as well. :)
This is what I'm talking about, only just hiding half of the view that called it:
I've searched on the internet for hours, but I seem to be missing some sort of key word. I've searched: iOS Menu, iOS Overlay Menu, iOS Options Menu, iOS Sharing Menu (as it resembled the old one), iOS Called Menu and variations of all of those. It would be extremely helpful if someone could tell me the name of this type of menu or possible explain how to make one.
That's called a UIActionSheet.
Is there is any way to turn off keyboard shortcuts in iOS 6 for particular textfield/textview?
I want to turn off keyboard shortcut for my app only and not from 'Settings app' of iOS.
I started writing my own text editor to achieve it.
You could try turning off autocorrection for your text field or text view with its autocorrectionType property—if the shortcut functionality is included in that (which seems likely), then it should get disabled as well. I’m pretty sure there’s no way to control the shortcut system itself; you might consider filing an enhancement request for it.
There is no standard way to turn off keyboard shortcuts on application level (For non jailbroken iOS).
To achieve this I stated with implementation of custom TextView with Core Text and UITextInput protocol.
Add #property for keyBoardShortCuts,
Override "tokenizer" getter method by following way to turn off shortcuts.
- (id <UITextInputTokenizer>)tokenizer {
if(self.keyBoardShortCuts)
return _tokenizer;
else
return nil;
}
If we remove tokenizer, there is be no keyboard shortcuts in custom view, even though shortcut are turned on from iOS setting.
Note: Take care of one thing, as we are not depending on tokenizer, now, in this case, use enumerateSubstringsInRange:range options:NSStringEnumerationByWords/Lines block to find out selection range for word or line.
To try this add above code in EGOTextView project to turn off default shortcuts.
From what I know, if you iphone is not jailbroken then you cannot turn it off for particular apps. It is more like a "master setting" that if changed, change applies to everything within iOS.
If it jailbroken, i know there are utility apps you can download that allow you to tweak the OS in that fashion...
Settings > General > Shortcuts. There are ready-made ones and any that you may have set up. They apply across all your iOS devices including your desktop Mac.
I know the typical way of resigning the first responder of the keyboard with code, however I don't see anyway to do this is the settings bundle. Any ideas, or is this a bug?
Thanks! :)
You could group the text fields and place them into Child Pane. Then you can use the Back key to dismiss the keyboard. Better than nothing :)
You can't execute any code in the settings app, you can only define what settings can be altered. If you want more control over settings then have them within your app, either manually or with something like InAppSettings kit.