Disabling Mousewheel Bind - key-bindings

I am Using Cloud9.io
I want to scroll UP the timeline in terminal but not go scroll up in commands when I move my mouse wheel up. I do not want mousewheel to function the same as up and down arrow keys. How can I disable the mousewheel bind?

In Cloud9 mousewheel sends up down keys only when terminal is in applicationKeypad mode, where local scrollback is not available. See https://github.com/c9/core/blob/766fa74cbf/plugins/c9.ide.terminal/aceterm/mouse.js#L269.
This is useful when viewing content piped through less, (e.g when doing git diff)
But sometimes terminal can get into applicationKeypad mode when it should not. This can happen if there are some errors in bash configuration, or when sessions are attached to the same terminal, and they all have different window sizes.
Simply disabling this keybinding won't help to enable scrolling.
If you see this with one terminal session, try connecting cloud9 support, they may help to fix your bash configuration.

Related

Mouse position offset while running Steam inside Weston

I installed and ran Steam inside Weston, when I enter Steam classic layout (not big screen), the mouse position is off where Steam thinks it's pointing at.
For example:
Here my cursor is not pointing at LIBRARY tab on the upper taskbar, however LIBRARY tab is highlighted, so Steam thinks my mouse is on LIBRARY:
enter image description here
And in settings window, it's the same, I am not pointing at the "Change" button but it is highlighted:
enter image description here
However, this problem only exists in upper taskbar, lower taskbar, and independently opened window like settings, in the middle part of Steam layout, including game list on the left, and details page of the game, cursor offset does not appear. In this picture, it shows the game name is highlighted correctly when my cursor is on it.
enter image description here
And if I open it in Big Screen mode, the problem does not appear:
enter image description here
Sorry for taking pictures from display directly because it's in a docker container and I can't correctly screenshot for many reasons. But I guarantee it's not the docker container's problem because if I ran weston&steam in a docker or directly in my local host, the same problem happened. So it should be the problem of whether weston or steam.
The cursor position is correct in the shell of and other apps running in the weston, so I think it's some wrong matching between Steam and weston, the problem is that I can't find why and where things go wrong.
I tried:
Inside Steam:
Running Steam without using weston, both in docker and out docker, it works fine.
Changing resolution (video dimensions) of Steam layout, turning off and on "Enlarge text and icons based on monitor size", "Enable smooth scrolling in web views", "Enable GPU accelerated rending in web views", "Enable hardware video decoding, if supported" in the Interface tab of settings. But it does not work.
Changing the display size for library user interface elements, it does not work.
Reading log:
Read kernel log, found no problem.
Read weston log, found some errors but running on local host also has same errors.
Read command line log, found no specific errors regarding steam layout.
Steam might not find or output cursor offset to log.
For weston:
I checked the log while starting to run weston, the resolution setting is the same as my desktop screen setting and steam setting, all are 1920x1080p. So should not be the problem of weston resolution.
I tried to add a weston.ini file to change the resolution, but failed due to seatd crash and then I felt no need for that because resolution is checked to be matched.
Inside .steam directory:
Checked same files between local host Steam folder and Steam folder in docker, either they are 100% the same, or the difference is just about timestamp. There are few files existing in docker but not on local host, I removed them and ran Steam, problem persists.
I also tried to locate the exact file where Steam layout is coded, but I didn't manage to find it.

How to make Delphi's IDE scroll correctly?

Recently I made a fresh install of Windows 10 and Delphi 2007.
On Windows mouse settings, I configured the vertical mouse wheel to scroll 5 lines.
Everything is working fine EXCEPT for the fact that when I'm in IDE editor, the mouse scroll wheel will behave in a unexpected way. It works OK when I scroll up, but when I scroll down, it will scroll very fast to the end of the file.
It may look like a trivial problem, but actually it is very annoying, because I use the mouse scroll wheel a lot to navigate in the editor, especially down, to find parts of the code, and instead of scrolling 5 lines, it scrolls a lot more, maybe 50...
The problem happens ONLY on the Delphi's IDE. If I open a file in Notepad, for instance, the scrolling works fine in both directions.
Is there any known bug related to this issue? Any fixes?
Well, there is evidently an issue with the mouse wheel which manifests itself when running under Parallels - see here
talking to the very helpful Parallels support, the problem is with 'smooth scrolling' implemented. When this is turned off, the editor in Delphi works fine. This apparently does happen with some programs and seems to be a Delphi problem rather than Parallels.
Also, for adjusting scroll-wheel sensitivity generally in Win10 see https://www.thewindowsclub.com/change-mouse-scroll-speed-windows
which says to go to Settings | Devices | Mouse & Touchpad and there are controls to set whether the mouse wheel scrolls a page at a time or multiple lines and another, a slider, to choose how many lines to scroll.
What works for me is adding a boot flag to the VM configuration -> Boot order -> Advanced settings -> Boot flags. Add this line to this box:
devices.usb.mouse=0
Works for me with Delphi 14.2 on Windows 10 in Parallels 16.5.0
For me this helped:
steps: System > Advanced System Settings > Advanced > Performance > Settings > UNCHECK smooth-scroll list boxes
In German: Deaktivieren: Systemeigenschaften: "Optimierten Bildlauf für Listenfelder verwenden"

Disable touch scrolling in xterm.js

How can I disable scrolling by touch on xterm.js?
I have a touchmove event on term.element that simulates cursor keys by swiping the appropriate direction. This works great in applications such as Midnight Commander that use the "alternate screen buffer", but in the default screen buffer that has scrollback (i.e. lynx or bash, for example), it scrolls the terminal (as it normally would) in addition to sending the ansi codes for the arrow keys.
I need to override this behaviour so scrolling does not happen when you swipe, without preventing scrolling by other means such as the mouse-wheel or the scrollbar, or interfering with other mouse events (and possibly touch events).
Tried preventDefault() on the event, even tried attaching it to various elements within the terminal, parentNode, and its parentNode. Same behaviour. Also tried position: absolute with bottom: 0px, but the way xterm.js simulates a terminal makes for abberant results.
Any ideas?
Ok. The solution is: add event.stopPropagation() at the top of the handler for the touchmove event. Attach it to the terminal element (i.e. term.element). Forget the overlay, pointer-events: none, etc. Works perfect. No additional garbage. I left in event.preventDefault() for another reason, but I think just the stopPropagation stands alone for this particular question.
I would like to add, if you just want to disable touch scrolling on the terminal all you need is:
term.addEventListener('touchmove',function(e){e.stopPropagation()});
Assuming your terminal object's name is 'term'.

Separate mouse for debugger

I am programming a Delphi (XE3) application where mouse position is important, but I would like to be able with another mouse to be able to set breakpoints without moving the primary mouse position. I may be pressing shift or control in the application I am trying to debug, so alt-tabbing to the IDE and setting a breakpoint with the keyboard keyboard won't work. Can Windows 7 easily be set up to do this?
It's possible to attach multiple keyboards and mice to a computer, and various video games can take advantage of the multiple input devices, but the OS in general does not take advantage of that. No matter how many keyboards and mice you attach, there's still just one input queue and one cursor on the screen.
If all you need is to set breakpoints without moving the mouse, then you can navigate the input caret to the desired line with the keyboard and then press F5 to toggle breakpoints.
If you need to be able to debug without interfering with the program at all, then you might need to use remote debugging. Although the documentation suggests using Remote Desktop to operate the remote program while you're sitting at the local system, that's not what you want to do in this situation because you'll still have just one set of input devices. Instead, log on to the remote computer from elsewhere (either directly, or via Remote Desktop on a third computer). It'll help to have two computers you can access from the same chair.

Using AutoHotKey to detect focus in Git Gui

I'm trying to write an AutoHotKey script that will activate my Git Gui window, refresh it, and put the focus in the commit-comment text box. Activating and refreshing are no problem, but I'm not having any success changing focus. AutoHotKey doesn't seem to be correctly detecting the child controls in the Git Gui window.
If I run AutoHotKey's Window Spy utility, switch to the Git Gui window, and put the mouse over the commit-comment text box, Window Spy shows the following output (abbreviated):
>>>>>>>>>>( Window Title & Class )<<<<<<<<<<<
Git Gui (Tyler08) C:/svn/Tyler08
ahk_class TkTopLevel
>>>>>>>>>>>>( Mouse Position )<<<<<<<<<<<<<
On Screen: 808, 727 (less often used)
In Active Window: 816, 735
>>>>>>>>>( Now Under Mouse Cursor )<<<<<<<<
ClassNN: TkChild18
Text:
Color: 0xF0F0F0 (Blue=F0 Green=F0 Red=F0)
So it looks like the class name of that edit box is TkChild18, and I would expect to be able to write the following in my AutoHotKey script:
NumpadAdd::
ControlFocus, TkChild18, Git Gui (Tyler08) C:/svn/Tyler08
return
But when I start this script and then press Numpad +, nothing happens. I expected the focus to move to the commit-comment text box, but the focus doesn't change at all.
In trying to troubleshoot this, I built the following script based on the AutoHotKey docs for ControlGetFocus:
NumpadAdd::
ControlGetFocus, OutputVar, Git Gui (Tyler08) C:/svn/Tyler08
if ErrorLevel
MsgBox, The target window doesn't exist or none of its controls has input focus.
else
MsgBox, Control with focus = %OutputVar%
Now if I activate the Git Gui window and press Numpad +, AutoHotKey pops up a message box that says: "Control with focus = TkChild1". No matter where the focus is -- whether the focus is in the commit-comment text box, or in the diff pane, or in the "New Commit" or "Amend Last Commit" radio buttons, or in any of the buttons -- AutoHotKey always reports that the focus is TkChild1. This disagrees with Window Spy, which is able to see all the child windows (TkChild18, etc.)
The above script does work with at least some other apps (as long as I change the window title in the second line). It shows its "target window doesn't exist..." failure message if a WPF element has focus (e.g. the Output window in Visual Studio 2010) but it succeeds if a WinForms control has focus (e.g. VS2010's Properties grid). So I know I've got the right syntax for the ControlGetFocus command. I suspect that Git Gui is doing something strange with its child windows (it's built with the Tk framework, which may do something weird that AutoHotKey can't handle).
Anyone have any ideas on how I can get AutoHotKey to successfully change focus within the Git Gui window?
Using AutoHotKey Basic v1.0.48.00 and mSysGit version 1.7.3.1-preview20101002 on 64-bit Vista.
I suspect that Git Gui is doing something strange with its child windows (it's built with the Tk framework, which may do something weird that AutoHotKey can't handle).
I suspect you're right. Most of Autohotkey's commands are merely wrappers for MSFT Win32 api calls. In this case, ControlFocus probably just wraps SetFocus(). If the TK framework doesn't respond to normal windows messages such as WM_SETFOCUS then these won't work.
Your code fails on my computer too. I've tried for a half hour to find a workaround, with no luck other than hacks. Obviously you can just send TAB keypresses until your commit message editbox has focus, but this is unreliable since we cannot accurately check which control does have focus.
So, the best I could come up with is to just resort to sending a basic Click to the box. I tried ControlClick which would prevent mouse movement, but alas, it failed just like all the other Control commands. Ironically ControlGetPos works which allows this solution (otherwise if the Git Gui window is resized, a hardcoded coordinate would fail).
SetTitleMatchMode, 2 ;// allow partial window title matches
NumpadAdd::
WinActivate, Git Gui
ControlGetPos, control_x, control_y, , , TkChild18, Git Gui
CoordMode, Mouse, Screen
MouseGetPos, mouse_x, mouse_y ;// grab current mouse screen position
click_x := control_x + 5 ;// we'll click 5 pixels inside the control
click_y := control_y + 5
CoordMode, Mouse, Relative
Click %click_x%, %click_y% ;// click relative to active window (moves mouse)
CoordMode, Mouse, Screen
MouseMove, %mouse_x%, %mouse_y%, 0 ;// restore old mouse position
return

Resources