google d8 (v8 shell) navigation on Mac (arrow keys) do not navigate - console

I'm using the v8 console (d8) on a Mac after installing it via brew install v8. Let's say I type something like:
const a = {};|
(where | is the cursor) - I want to move the cursor back so that it's in between the curlies, like so:
const a = {|};
But, when I press the back button, I get:
const a = {};^[[D^[[D
... Is there a way to fix this or even a key combination I can use to navigate?
Thanks!

The feature you're looking for is called "readline support", named after the library that provides it. d8 does not currently have such support. Thankfully, there's a handy tool named rlwrap that emulates readline support for arbitrary interactive terminal programs. Installing that and then running d8 as rlwrap d8 should give you what you want :-)

Related

How can I listen for global mouse events in Elm 0.19?

To listen for mouse events on an HTML element in Elm, we can use Html.Events.onClick. However, I want to listen for mouse clicks anywhere on the document.
I found the elm-lang/mouse package that provides Mouse.clicks which seems to be intended for just that. On Elm 0.18, it can be installed like this:
elm-package install elm-lang/mouse
And imported like this:
import Mouse exposing (clicks)
But on Elm 0.19, the command
elm install elm-lang/mouse
does not work:
The following packages do not work with Elm 0.19.0 right now:
elm-lang/mouse
No reason is given in the console output. The documentation does not seem to indicate anything about this module has changed with version 0.19.
How can I install the module? Or alternatively, how can I use Elm's standard library to listen for mouse clicks globally (on the document)?
The package has been merged into elm/browser.
So rather than Mouse.clicks, you now use Browser.Events.onClick.
See the documentation for the browser package here.
To retrieve the mouse position, use Json.Decode:
import Browser.Events exposing (onClick)
import Json.Decode as Decode
type alias Msg =
{ x : Int, y : Int }
subscriptions : Model -> Sub Msg
subscriptions model =
onClick
(Decode.map2 Msg
(Decode.field "pageX" Decode.int)
(Decode.field "pageY" Decode.int)
)
For other attributes, see the documentation on MouseEvent.
Quick online demo for click and move.

Return Key in Edit Command Mode Shortcuts - Jupyter Notebook

While willing to write ↩a as a new shortcut for the run all cells above command I could not find how to specify the return symbol in Jupyter Notebook.
Writing return-a or ↩-ain the Edit Command Mode does not work and the modifier is not specified in the help dialog.
Any idea?
Return is not a modifier so shortcut like ↩-a make little sens (pressing enter and A at the same time. ↩,a meaning Return key followed by A key make more sens, but Enter is so pervasive for many actions that it is not usable in user shortcuts. I would suggest you to open an issue on jupyter/notebook on GitHub to ask for return to be added as a convenient way to map to ↩ , though even if we do that we can't guaranty that it will work. If you are willing to try to code that yourself, have a look at keyboard.js, the mapping from enter to displaying ↩ is already done in quickhelp.js, for mac at least.

Click element, hold Shift key and click another element in robotframework

I need to be able to click an element on a webpage and hold the Shift key on keyboard and press another element.
Can I implement this behaviour using "Press Key" in Selenium2Library?
You can try to achieve your scenario using AutoItLibrary
First you need to install win32com.client, use below command
pip install pypiwin32
Then use AutoItLibrary command like as per your requirement
Send | {SHIFTDOWN}
For more info visit here
Use using Pyautogui library. This library simulates the User Actions on GUI such as Mouse Control, Keyboards inputs,etc. You can find details at
https://www.google.co.in/url?sa=t&rct=j&q=&esrc=s&source=web&cd=1&cad=rja&uact=8&ved=0ahUKEwjN1ZbrocrSAhWIFJQKHXbiBGcQFggbMAA&url=https%3A%2F%2Fpyautogui.readthedocs.io%2F&usg=AFQjCNEe5LY5eMdaquVD421_u-mpoFUOYQ&sig2=Lj-e4YldvbLNEvPe4NFHrA
Also U can install this library using pip by following keywords in following docs
http://pyautogui.readthedocs.io/en/latest/install.html

How to catch user pressing escape key in Atom Package

I am developing an Atom package, and I have certain commands that get executed when I press Ctrl-Shift-Up.
The first time I press Ctrl-Shift-Up, Atom enters a "mode" where things happen differently. Now, I think I know how to do that part. But I don't know how to tell atom to hijack the Escape key.
You can assign a command to Esc through your package keymap.
Example:
'atom-text-editor:not([mini])':
'escape': 'my-package:do-stuff'
If your CtrlShift↑ shortcut creates a custom view, you would want to limit your shortcut to its CSS selector.
Example:
'.my-custom-view':
'escape': 'my-package:do-stuff'
Further reading:
Atom Flight Manual: Keymaps In-Depth
Atom API: KeymapManager

Qt Embedded for Linux. Keyboard layout switching

I'm developing application with Qt Embedded and run it in linux framebuffer. I need a way to type non-US characters. Is it possible to change keyboard layout with Qt?
I tried to run it on Qt/X11. Layout switching and input are perfectly fine there.
But when I compile it with Qt/Embedded and run it in framebuffer I cannot change layout.
I searched in the documentation and didn't find anything about layout switching.
I think it has something to do with qt keyboard driver as specified at the documentation.
It seems that I should develop my own keyboard driver. But I'm using standard keyboard and I think there must be a standard way to change input language?
What would you suggest?
BTW, I'm using 4.5 version. Maybe 4.6 has something to solve this issue?
Exact the same problem here:
http://lists.trolltech.com/pipermail/qt-embedded-interest/2008-August/000034.html
http://lists.trolltech.com/qt-interest/2004-02/msg00570.html
Version 4.6 has gained keymap support. Solution:
generate kmap file:
ckbcomp -layout xx > xx.kmap
convert kmap to qmap
kmap2qmap xx.kmap xx.qmap
load keymap either by
specifying QWS_KEYBOARD environment variable:
QWS_KEYBOARD="TTY:keymap=xx.qmap"
or loading a keymap dynamically:
QWSKeyboardHandler * currentKeyboardHandler =
QKbdDriverFactory::create("TTY", "keymap=foo.qmap");
Make sure that you delete created handler when you create a new one:
delete currentKeyboardHandler;
currentKeyboardHandler =
QKbdDriverFactory::create("TTY", "keymap=bar.qmap");
Seems like Qt for Embedded linux is superseeded by Project Lighthouse. Not sure though, if it is production ready, neither I know how does it handle keyboard layout switching.
Update
Qt5 doesn't have QWS and all QWS-related APIs are removed. So you'll need some thirdparty solution. Or write a plugin for QPA.
I need a way to type non-US characters
You can change qmap, but even in Qt 4.8.0 there is no way to switch between US and russian (for example). You need to patch kmap2qmap (add AltGr_Lock support), qkbd_qws.cpp (change testmods according to state of AltGr_Lock). It's looks like no one is used QtEmbedded with keyboard. Or all keeps final patches in secret place.
Can't comment, so this is the answer to
You need to patch kmap2qmap (add AltGr_Lock support), qkbd_qws.cpp (change testmods according to state of AltGr_Lock).
This simple patch to qkbd_qws.cpp enables switch beteewn languages by the CapsLock button.
523,526c523,524
< //if (d->m_locks[0] /*CapsLock*/ && (m->flags & QWSKeyboard::IsLetter))
< // testmods ^= QWSKeyboard::ModShift;
< if (d->m_locks[0] /*CapsLock*/)
< testmods ^= QWSKeyboard::ModAltGr;
---
> if (d->m_locks[0] /*CapsLock*/ && (m->flags & QWSKeyboard::IsLetter))
> testmods ^= QWSKeyboard::ModShift;

Resources