Keyboard Shortcuts?

Is there a list of hot keys in Xojo (apart from the ones on the menu)?

Here are a few that might help…

https://documentation.xojo.com/index.php/Keyboard_Shortcuts

Found this, does not say much :wink:
Keyboard Shortcuts

I think we posted at exactly the same time.

Could only find the topic “Keyboard Shortcuts” in LR (Xojo Language Reference) that literally contains only four shortcuts for “Code Editor” and nothing else. No such topic as “Hot Keys” in LR. May be the Xojo team had no time to code or document all for the 2013r1.

That’s a start. Thanks!

Didn’t know about:
Cmd + [Double-click on method] Navigate to the method that was double-clicked.

Handy.

[quote=16905:@Stephen Dodd]Didn’t know about:
Cmd + [Double-click on method] Navigate to the method that was double-clicked.
[/quote]

Works with constants/properties as well.

Cool!

The Mac IDE should also support all of the standard Cocoa text editing shortcuts.

User Guide Book 1: Fundamentals, Overview (Chapter 1), Keyboard Shortcuts section covers all the menu-related keyboard shortcuts.

Code Editor keyboard shortcuts are on the previously mentioned LR page and will be in the Code Editor section in the next User Guide update.

If you know of other keyboard shortcuts that ought to be documented, do create a Feedback case for them so that I can update the User Guide.

I am in need of some help. I need to determine what keyboard shortcut key has been pressed in a TextArea.

In the KeyDown method, I have code

if TargetWin32 then if KeyBoard.ControlKey then if KeyBoard.AsyncKeyDown(&h23) then //CTRL & p StartMovieatTime return true elseif KeyBoard.AsyncKeyDown(&h22) then//CTRL & i 'TLSClipboard.Append(transcriptionText.text) //save current contents into clipboard CopyToCLipboard MarkAsInterjection return true elseif KeyBoard.AsyncKeyDown(&h0E) then //CTRL & e 'TLSClipboard.Append(transcriptionText.text) //save current contents into clipboard CopyToCLipboard markeventType("event") transcriptionText.SelAlignment = TextArea.AlignLeft //CTRL+e usually sets alignment of the paragraph to centre. This undoes that style change return true elseif KeyBoard.AsyncKeyDown(&h11) then //Ctrl & t CopyToClipboard MarkAsTitle return true else return false end if end if

This works fine for predetermined keys but I want the user to be able to select their own shortcuts, for example, replace the ‘p’ by a ‘1’, if that’s what they prefer.

I can not find any way of working out what key has been pressed in conjunction with the Ctrl key.

I am looking for a code statement like

 if KeyBoard.AsyncKeyDown(keyPressed) then //CTRL & keyPressed variable

Can anyone advise how I achieve this?

thanks

bobj

In typical RealStudio/Xojo style, I found a simple solution that appears to work, at least for US keyboards.

I load a dictionary as follows (in the App object:

keycodesDictionary = new dictionary keycodesDictionary.Value("1") ="a" keycodesDictionary.Value("2") = "b" keycodesDictionary.Value("3") = "c" keycodesDictionary.Value("4") = "d" keycodesDictionary.Value("5") = "e" keycodesDictionary.Value("6") = "f" keycodesDictionary.Value("7") = "g" keycodesDictionary.Value("8") = "h" keycodesDictionary.Value("9") = "i" keycodesDictionary.Value("10") = "j" keycodesDictionary.Value("11") = "k" keycodesDictionary.Value("12") = "l" keycodesDictionary.Value("13") = "m" keycodesDictionary.Value("14") = "n" keycodesDictionary.Value("15") = "o" keycodesDictionary.Value("16") = "p" keycodesDictionary.Value("17") = "q" keycodesDictionary.Value("18") = "r" keycodesDictionary.Value("19") = "s" keycodesDictionary.Value("20") = "t" keycodesDictionary.Value("21") = "u" keycodesDictionary.Value("22") = "v" keycodesDictionary.Value("23") = "w" keycodesDictionary.Value("24") = "x" keycodesDictionary.Value("25") = "y" keycodesDictionary.Value("26") = "z" keycodesDictionary.Value("200") = "f1" keycodesDictionary.Value("201") = "f2" keycodesDictionary.Value("202") = "f3" keycodesDictionary.Value("203") = "f4" keycodesDictionary.Value("204") = "f5" keycodesDictionary.Value("205") = "f6" keycodesDictionary.Value("206") = "f7" keycodesDictionary.Value("207") = "f8" keycodesDictionary.Value("208") = "f9" keycodesDictionary.Value("209") = "f10" keycodesDictionary.Value("210") = "f11" keycodesDictionary.Value("211") = "f12"

Then I use the following code in the KeyDown handler of the TextArea to check for a match on the configured shortcut key:

if KeyBoard.ControlKey then if App.keycodesDictionary.Value(Str(Asc(key))) = App.playshortcut then //CTRL & p &h23 StartMovieatTime return true end if if App.keycodesDictionary.Value(Str(Asc(key))) = App.interjectionshortcut then//CTRL & i &h22 CopyToCLipboard MarkAsInterjection return true end if if App.keycodesDictionary.Value(Str(Asc(key))) = App.eventshortcut then //CTRL & e &h0E CopyToClipboard markeventType("event") transcriptionText.SelAlignment = TextArea.AlignLeft //CTRL+e usually sets alignment of the paragraph to centre. This undoes that style change return true end if if App.keycodesDictionary.Value(Str(Asc(key))) = App.titleshortcut then //Ctrl & t &h11 CopyToClipboard MarkAsTitle return true end if

So far, this appears to work but only for characters a to z and the function keys. It does not work for numbers but that may be just a limitation we have to liver with. For using the function keys, the user just types f1, f2, f3, etc, into the configuration field.

It would still be interesting to get a generalised answer though, working for any Ctrl + key combination.

bobj