WelcomeWelcome | FAQFAQ | DownloadsDownloads | WikiWiki

Author Topic: using GUI desktop without mouse  (Read 3299 times)

Offline bonbonbaron

  • Newbie
  • *
  • Posts: 22
using GUI desktop without mouse
« on: January 18, 2020, 12:48:03 PM »
I bought a Targus AKB122 keyboard, which has a micro-USB plug, to use with my Pi Zero W. (This Pi only has one micro USB slot available other than power. I'd like to avoid buying multi-USB peripherals if I can.)

Since I've always been able to jump around Windows 7 and 10 using just my keyboard, I figured I'd be able to do the same in TinyCore. This is not the case. When I run startx, an ugly mouse pointer sits in the  middle of the screen, and none of my keyboard buttons do anything. Tried going back to command line with ctrl+alt+backspace, nothing. Ctrl+alt+T, nothing. I'm stuck until I unplug the Pi. I had to add bootcode "text" to rescue my future boots from this situation.

Searching for workarounds, I googled around and saw something about using numpad to simulate mouse movements, but my keyboard has no numpad. Is mouse usage absolutely necessary? If so, can I somehow map my arrow keys to mouse motions? If I can, then how?

Thanks for your time,
Michael

Offline Rich

  • Administrator
  • Hero Member
  • *****
  • Posts: 11694
Re: using GUI desktop without mouse
« Reply #1 on: January 18, 2020, 01:19:02 PM »
Hi bonbonbaron
I sounds like maybe you want to get rid of the mouse cursor completely? If so, open your  .xsession  file and change:
Code: [Select]
/user/local/bin/Xorg -nolisten tcp &to:
Code: [Select]
/user/local/bin/Xorg -nolisten tcp -nocursor &

Offline bonbonbaron

  • Newbie
  • *
  • Posts: 22
Re: using GUI desktop without mouse
« Reply #2 on: January 18, 2020, 01:38:21 PM »
open your  .xsession  file and change:
Code: [Select]
/user/local/bin/Xorg -nolisten tcp &to:
Code: [Select]
/user/local/bin/Xorg -nolisten tcp -nocursor &
.xsession doesn't have any lines with /usr/local/bin/Xorg.

However, I did figure out how to bring up the right-click menu with Alt+Tab. However, nothing in the SystemTools submenu does anything except for XKill (useless without mouse I think) and Top. My guess is, I'm missing some TCZ files.
« Last Edit: January 18, 2020, 01:55:14 PM by bonbonbaron »

Offline bonbonbaron

  • Newbie
  • *
  • Posts: 22
Re: using GUI desktop without mouse
« Reply #3 on: January 18, 2020, 02:35:03 PM »
Ah... I tce-loaded gtktetris, which in turn grabbed from font configuration dependencies, and all the System Tools started working. Before that, when the SystemTools weren't working, I tried running them from command line and got a "libfontconfig.so.1 couldn't be found" error, which tipped me off. Seems "tceload -wi TC" missed this.

Offline bonbonbaron

  • Newbie
  • *
  • Posts: 22
Re: using GUI desktop without mouse
« Reply #4 on: January 20, 2020, 04:10:38 PM »
Is there a way to configure which keyboard buttons simulate mouse movements after startx? I have a keyboard without a numpad and no mouse.

Offline Rich

  • Administrator
  • Hero Member
  • *****
  • Posts: 11694
Re: using GUI desktop without mouse
« Reply #5 on: January 20, 2020, 10:32:17 PM »
Hi bonbonbaron
...  When I run startx, an ugly mouse pointer sits in the  middle of the screen, ...

Searching for workarounds, I googled around and saw something about using numpad to simulate mouse movements, ...
You could try using  xdotool.tcz  to move the mouse cursor to the lower right corner where it should be virtually invisible:
Code: [Select]
xdotool mousemove 1024 768Replace  1024 768  with your screens resolution, or just set it to something big like  2000 2000  if you don't know your resolution.

You can use the  xdotool  command to emulate a mouse using your keyboard if you can find a program to bind commands to keystrokes.
Examples of mouse commands:
Code: [Select]
xdotool mousemove_relative -- 10 0    # Move mouse 10 pixels right.
xdotool mousemove_relative -- -10 0   # Move mouse 10 pixels left.
xdotool mousemove_relative -- 0 10    # Move mouse 10 pixels down.
xdotool mousemove_relative -- 0 -10   # Move mouse 10 pixels up.
xdotool click 1                       # Single click left mouse button
xdotool click --repeat 2 1            # Double click left mouse button
xdotool mousedown 1                   # Press left mouse button
xdotool mouseup 1                     # Release left mouse button

Offline bonbonbaron

  • Newbie
  • *
  • Posts: 22
Re: using GUI desktop without mouse
« Reply #6 on: January 21, 2020, 09:35:14 AM »
You can use the  xdotool  command to emulate a mouse using your keyboard if you can find a program to bind commands to keystrokes.
Examples of mouse commands:
Code: [Select]
xdotool mousemove_relative -- 10 0    # Move mouse 10 pixels right.
xdotool mousemove_relative -- -10 0   # Move mouse 10 pixels left.
xdotool mousemove_relative -- 0 10    # Move mouse 10 pixels down.
xdotool mousemove_relative -- 0 -10   # Move mouse 10 pixels up.
xdotool click 1                       # Single click left mouse button
xdotool click --repeat 2 1            # Double click left mouse button
xdotool mousedown 1                   # Press left mouse button
xdotool mouseup 1                     # Release left mouse button
Oh that's awesome, thanks Rich!

Google had me trying xmodmap yesterday, but I think that just maps keyboard keys to other keys and mouse clicks. But if piCore has the bind command (won't know till I get off work), that may let me do things like Shift+ArrowKeys to move the mouse. Hopefully TCL has it, and if it does, I'll try that next.

Side comment: I've learned more about computers in a week on Tiny Core Linux than I did in ten years on my Windows desktop.

Offline Rich

  • Administrator
  • Hero Member
  • *****
  • Posts: 11694
Re: using GUI desktop without mouse
« Reply #7 on: January 21, 2020, 10:12:55 AM »
Hi bonbonbaron
The  xbindkeys  program would allow you to bind commands to keystrokes. Unfortunately, I don't see it listed in the 9.x piCore
repository.

Offline bonbonbaron

  • Newbie
  • *
  • Posts: 22
Re: using GUI desktop without mouse
« Reply #8 on: January 21, 2020, 11:09:13 PM »
Hi bonbonbaron
The  xbindkeys  program would allow you to bind commands to keystrokes. Unfortunately, I don't see it listed in the 9.x piCore
repository.
If bind won't do the trick, then it sounds like I'm SOL.

Offline Rich

  • Administrator
  • Hero Member
  • *****
  • Posts: 11694
Re: using GUI desktop without mouse
« Reply #9 on: January 22, 2020, 12:26:01 AM »
Hi bonbonbaron
Some window managers allow you to map commands to keys (shortcuts). xfce is one of them.

Also  openbox:
http://openbox.org/wiki/Help:Bindings

And  JWM:
https://wiki.archlinux.org/index.php/JWM
http://joewing.net/projects/jwm/config-2.3.html#keys