I've just started programming in R and have discovered you make comments by using #.
I've never been too concerned with this key as I normally program using Matlab or C++.
I'm using Windows 8 on a Macbook Pro so the keyboard doesn't have a designated # key and the shortcut for an apple keyboard for the # key (which is alt+3) doesn't work.
I haven't been about to find a solution for this. Thanks.
On an Apple Keyboard, whilst using a third-party OS such as Windows, you type the # symbol by pressing the 2nd Alt key + 3.
The first (left hand side) Alt key doesn't have a shortcut function.
This applies to all programs (Visual Studio, R, Word etc).
When using Windows the keyboard reverts to a standard Windows keyboard layout, which is different from the Mac layout for some keys. So the hash key is mapped to what is marked as the backslash key \, to the left of the return, and the # key is mapped to the double inverted comma.
I've got an Apple "Magic Keyboard" on UK settings and can get the hash symbol by holding Command and pressing the Backslash key
I'm using Ubuntu Xfce on a Macbook, and none of the above answers helped me at all. Then I found I could type a hash character using SHIFT + RIGHT ALT + = twice. It makes sense, because a hash character looks like two '+' signs.
The RIGHT ALT key is listed in my Settings -> Keyboard -> Layout as the 'Compose Key', so if it doesn't work, check what your Compose Key is and try that.
Related
i can't for the love of me find the vk code for this, i want to make a program which detects if it's been pressed and uses send input to input a < instead of ç
I'm not using autohotkey because it would be half as fun as coding it myself and like using a chainsaw to cut a piece of steak
what is the vk code for the backslash above enter
It really depends on your keyboard.
Per the Virtual Key Codes documentation, it is likely VK_OEM_5:
VK_OEM_5
0xDC
Used for miscellaneous characters; it can vary by keyboard.
For the US standard keyboard, the '\|' key
Which is indeed the \ key above the Enter key on my keyboard.
But, if you don't have a US keyboard, then it may be VK_OEM_102 instead:
VK_OEM_102
0xE2
Either the angle bracket key or the backslash key on the RT 102-key keyboard
So, you will just have to write some code to test which key code is actually reported when pressing the \ key on your keyboard.
I would like to send two simultaneous keys such as ALT+S to the sendKeysToActiveElement( function of the R Selenium webdriver. I only see implementations in Java and C. Can this be done?
If you want to send a single keystroke then use:
cl$sendKeysToActiveElement(sendKeys = list(key = "tab"))
If you press more than two keystrokes then use:
cl$sendKeysToActiveElement(sendKeys = list(key = "alt", key = "S"))
There are 2 ways to send key presses in the in the R version of Selenium. The first way, as mentioned, is by sending the desired button in the key argument. The second way is by sending the raw UTF-8 character codes without the key argument. Generally, this is undesired because it's difficult to remember all the codes, but when wanting to input simultaneous key presses, it's the only way I've found to make it work since the list option does appear to send inputs sequentially.
In this scenario, the UTF 8 code for alt is \uE00a
and the UTF 8 code for s is \u0073
We can combine these into a single value, like so:
remDr$sendKeysToActiveElement(sendKeys = list("\uE00a\u0073"))
I'm unfamiliar with the alt + s shortcut, but this does work with something like shift + tab to navigate through different elements in reverse on a browser by sending them simultaneously.
I've also found the following links helpful for finding the actual UTF 8 codes:
http://unicode.org/charts/PDF/U0000.pdf
https://seleniumhq.github.io/selenium/docs/api/py/_modules/selenium/webdriver/common/keys.html
Use below code :-
String selectAll = Keys.chord(Keys.ALT, "s");
driver.findElement(By.xpath("YOURLOCATOR")).sendKeys(selectAll);
Hope it will help you :)
In Mac OS X Ctrl+Cmd+g replaces a word in the whole file. What's the alternative to that in Linux?
I tried to check the keybindings, but no luck.
You can use Command+. to active the Key Binding Resolver to look for the actual function bound to the shortcut on your Mac and search the function on Linux Atom to figure out what the key combination is.
Alternatively, your can search all your key binding here (see screenshot below) which accept both key combination and command name.
Using ctrl + e when you are on a word will open the find and replace panel for this word.
Then use tab to go into the "replace in current buffer field", type your replacement word.
Finally, hit enter to replace the occurrences one by one, or ctrl + enter to replace all.
I have an SQLite database that contains values with strange characters like ü, é, etc. SQLite is UTF8 by default and the values look good in a database tool.
Now I need to fill an option menu in Livecode with these values.
When I do
put uniencode ("Krüger", "utf8") into tData
set the text of button "option" to tDAta
I get the correct value in the option button but looking strange with big spacings like "K r ü g e r" instead of "Krüger"
Edit: It appears to be that the Text is displayed in "full width". I am using Tahoma but changing the font does not make a difference.
If I don't do uniencode I get "Krüger".
I also tried set the unicodetext of button "option" to tData but that gave me one line of chinese or japanse chars or so.
Where is my mistake?
I am using Livecode 7.0.6.
put textDecode(MyVariable,”UTF8”) into NewVariable
The uniencode and unidecode functions are deprecated as of LiveCode 7. In your example, try:
put revDataFromQuery(,, tConnectionId, tQuery) into tUTF8data
set the text of button "option" to textDecode(tUTF8data,"utf8")
On Unix, when I press up arrow key, it shows this string, but while scanf, it does not take it as input. Please explain how to take it as input. Can we something like compare the character by charater like first ^[ is Esc key and so on?
That's the escape sequence generated by that key. '^[' is CTRL-[ (the ESC character), and the other two characters are '[' and 'A'.
If you want to process them, you'll need to read all three characters and decide that they mean the user pressed the up-arrow key.
Whether or not you can do this with your scanf depends on the format string. I would be using a lower level of character input for this.
I never use [f]scanf in real code since failure results in you not knowing where the input pointer is located. For line-based input, I find it's always better to use fgets and then sscanf the string retrieved.
But, as I said, you should be using getc and its brethren for low-level character I/O. Or find a higher level function such as readline under Linux, or other libraries that know to convert it into special keycodes such as VK_KEY_UP that you can process.