How to label return key in custom keyboard based on text input type - objective-c

I am creating a custom keyboard. I have a button for Return/Go/etc. If the user is entering a URL, my button text should be "Go". If she is writing in note, it should be "Return".
How can my keyboard extension figure out what label to put on the button?

Your text document proxy conforms to UITextInputTraits, so you want to use self.textDocumentProxy.returnKeyType or .keyboardType.

Related

set the text of an Action Control to a document property

Is there a way to set the text of an Action Control to the value of a document property?
i.e. I have a property FooProp. I want to set the label text of a button to ${FooProp} so that when FooProp gets updated (via script), the button text changes.
Thanks.
I do not think you can set the Display Text of a button to a document property.
You could really easily create an HTML button that does similar functionality but could still have a dynamic title. Simply create a button and set the name of the button to a Spotfire Label equal to that Document Property. Then perhaps use a python script or other script to do work e.g. change page, load data, etc. Depends on your use case.

How do I avoid using the mouse when extracting to field in IntelliJ

When I press Alt+Cmd+F to extract a piece of code to a field, I'd like it to be final and initialised in the field declaration, but I have to use the mouse to click on the dropdown in the pop-up. How can I do this without using the mouse?
You can press ⌘+Alt+F twice, which will show separate dialog in which you can tab through the individual options using the keyboard.

How to create link in SharePoint custom text field?

I have created custom text field MyItemURL, I am trying to achieve thru coding if user click on Click Me the link should open, but in my coding entire url is appearing under MyItemURL. Just wanted to display Click Me link, how can i do this?
Here is my code:
string completeURL="MyItemComplete URL generated here";
listitem["MyItemURL"]=" Click Me ";
listitem.update();
In listitem["MyItemURL"]=" Click Me you are assigning the value of a text field, not an HTML fragment. If you want a URL field, then use SPFieldUrl and not SPFieldText.

Need to change focus to another text box before buttons are activated

I am entering data into text fields in a browser via "type" command. In order for the Save and Cancel buttons to be activated (not grayed out), I need to click in another text field to change focus. This works manually, but I can't seem to figure out how to do it programmatically. I have tried click, clickAt, doubleClick, mouseOver/click/mouseOUt, mouseDown/mouseUp, focus, fireEvent ... all without luck. Thanks for any suggestions!
Does tabbing out of the input field enable the buttons? If so, maybe you can just do:
WebElement element = driver.findElement(By.id("your_input_field"));
element.sendKeys(Keys.TAB);

Using Enter key to invoke different methods in Mac(objective c)

I am new to Objective c programming. I have created an application which has a UI with two buttons "Cancel" and "Ok". On clicking "Cancel", the application must terminate and clicking "Ok" must perform some task. Everything works fine. I am able to tab between these buttons and can call the required functionality by clicking space button.
All I want to do is, that when focus is on "Cancel" button(using tab key) then on clicking enter button from keyboard, my application should terminate and similarly, when focus is on "Ok" button then clicking enter should perform the desired functionality.
I have even set the 'setKeyEquivalent" property of the "Ok" and "Cancel" button, but I can only set unique keyequivalents. I also tried to read the title or tag value of the buttons and then call the required functionality but it didn't worked too.
Can someone please guide me how can I use enter button to invoke different functions depending upon the selected button in UI.
I think you don't want to set key equivalents for the buttons. You would want to override keyDown: and test for the enter key, then do the appropriate thing depending on which button had focus (which I think you could determine using NSWindow's firstResponder method).