LinuxQuestions.org
Did you know LQ has a Linux Hardware Compatibility List?
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices



Reply
 
Search this Thread
Old 12-06-2012, 09:52 AM   #1
ununun
Member
 
Registered: Jun 2011
Posts: 82

Rep: Reputation: Disabled
disable keyboard temporarily so that a book on keyboard does nothing.


i sometime need to place a book on keyboard but then i also dont want it to press key randomly. so i am looking for a way to,
temporarily disable a keyboard except for few keys like up/down for scrolling and another 'control key' for enabling/disabling.

meanwhile i experiement with keymap.

thanks
 
Old 12-07-2012, 10:51 AM   #2
Soadyheid
Member
 
Registered: Aug 2010
Location: Near Edinburgh, Scotland
Posts: 832

Rep: Reputation: 150Reputation: 150
Humour me... Why do you need to put a book on the keyboard?

Have you tried putting the keyboard on your knees, book on the table/desk?
Putting your keyboard/system on a bigger table/desk which will also accomodate the book?
Put the book on the table/desk and the keyboard standing vertically to the left ot right of the table/desk?
Getting a separate bookstand (like a music stand)?

Then there's...

Get a pdf file of the book and display it on your left or right hand screen? Huh? You don't have two screens?
Nail the book to the wall behind your screen... (sorry becomming silly now so I'll stop.

Then again...maybe unplug the keyboard and fit a USB number keypad(much smaller)? You'd get home, pg up, arrow keys,etc.

Play bonny!
 
Old 12-07-2012, 02:48 PM   #3
User\ Name=`echo $USER`
LQ Newbie
 
Registered: Oct 2012
Location: Oklahoma
Distribution: Red Hat, Ubuntu, Mac OS X
Posts: 25

Rep: Reputation: 4
I agree with Soadyheid. First of all, I don't know why you would be doing such a thing, but if you have to, I'd say move it or unplug it.

Out of curiosity, is this just a hypothetical question to see if it can be done, or is it for a reason?
 
Old 12-07-2012, 10:58 PM   #4
rknichols
Senior Member
 
Registered: Aug 2009
Distribution: CentOS
Posts: 1,614

Rep: Reputation: 675Reputation: 675Reputation: 675Reputation: 675Reputation: 675Reputation: 675
s/book/cat/ and you would have my reason for wanting to disable the keyboard occasionally. (Of course, I'm not the one "placing" the cat on the keyboard.)
 
Old 12-07-2012, 11:38 PM   #5
ununun
Member
 
Registered: Jun 2011
Posts: 82

Original Poster
Rep: Reputation: Disabled
i have a laptop which is either or my lap or a small desk. so cant do anything suggested.

Quote:
Out of curiosity, is this just a hypothetical question to see if it can be done, or is it for a reason?
i know its bit silly, but imagine you reading from a pdf in laptop which has two usb connections and one power, now you want to take notes and moving this whole setup seems trickier than disabling the keyboard temporarily and then keyboard (of laptop) can work as support pad too. before any one say, cant close the lid either.

i am still digging though but i think an almost-null keymap with only few assigned keys (control key at least) would work. can double keystroke be assigned as a global shortcut system wide (independent of X) ?

Last edited by ununun; 12-07-2012 at 11:44 PM.
 
Old 12-09-2012, 06:15 AM   #6
Soadyheid
Member
 
Registered: Aug 2010
Location: Near Edinburgh, Scotland
Posts: 832

Rep: Reputation: 150Reputation: 150
Quote:
i have a laptop which is either or my lap or a small desk.
Aha! This is a vital piece of information which you didn't supply when you originally posted the question!

The solution is therefore much clearer!

Quote:
i know its bit silly, but imagine you reading from a pdf in laptop which has two usb connections and one power, now you want to take notes and moving this whole setup...
Wrong! You don't move the laptop, you move the notes!

If the notes you are taking are on loose paper (or will be fitted into a loose leaf binder) Buy a clip board and. with the laptop on the table, hold the clip board in one hand while writing notes with the other. The clip board can be laid on your lap/the floor or wherever while you use the laptop.
Use a hard backed notebook if loose leaf is not an option.

Tah Dah!

Play Bonny!
 
Old 12-09-2012, 06:20 AM   #7
H_TeXMeX_H
Guru
 
Registered: Oct 2005
Location: $RANDOM
Distribution: slackware64
Posts: 12,928
Blog Entries: 2

Rep: Reputation: 1269Reputation: 1269Reputation: 1269Reputation: 1269Reputation: 1269Reputation: 1269Reputation: 1269Reputation: 1269Reputation: 1269
I would use xlock or xlockmore to lock the screen, that way you need to put in a password and that's unlikely to be entered with a book. It's not 100%, but the only 100% solution is to unplug the keyboard or stop putting a book on the keyboard.
 
Old 12-09-2012, 09:15 AM   #8
ununun
Member
 
Registered: Jun 2011
Posts: 82

Original Poster
Rep: Reputation: Disabled
got it (almost) .

it uses xmodmap so it depends on X .
the basic idea is to use different .Xmodmap .

.Xmodmap_null
Code:
keycode 8 =
keycode 9 = Escape NoSymbol Escape 
keycode 10 =
keycode 11 =
keycode 12 =
keycode 13 =
keycode 14 =
keycode 15 =
keycode 16 =
keycode 17 =
keycode 18 =
keycode 19 =
keycode 20 =
keycode 21 =
keycode 22 =
keycode 23 = Tab ISO_Left_Tab Tab ISO_Left_Tab Tab ISO_Left_Tab
keycode 24 =
keycode 25 =
keycode 26 =
keycode 27 =
keycode 28 =
keycode 29 =
keycode 30 =
keycode 31 =
keycode 32 =
keycode 33 =
keycode 34 =
keycode 35 =
keycode 36 =
keycode 37 =
keycode 38 =
keycode 39 =
keycode 40 =
keycode 41 =
keycode 42 =
keycode 43 =
keycode 44 =
keycode 45 =
keycode 46 =
keycode 47 =
keycode 48 =
keycode 49 =
keycode 50 =
keycode 51 =
keycode 52 =
keycode 53 =
keycode 54 =
keycode 55 =
keycode 56 =
keycode 57 =
keycode 58 =
keycode 59 =
keycode 60 =
keycode 61 =
keycode 62 =
keycode 63 =
keycode 64 = Alt_L Meta_L Alt_L Meta_L Alt_L Meta_L
keycode 65 =
keycode 66 =
keycode 67 =
keycode 68 =
keycode 69 =
keycode 70 =
keycode 71 =
keycode 72 =
keycode 73 =
keycode 74 =
keycode 75 =
keycode 76 =
keycode 77 =
keycode 78 =
keycode 79 =
keycode 80 =
keycode 81 =
keycode 82 =
keycode 83 =
keycode 84 =
keycode 85 =
keycode 86 =
keycode 87 =
keycode 88 =
keycode 89 =
keycode 90 =
keycode 91 =
keycode 92 =
keycode 93 =
keycode 94 =
keycode 95 =
keycode 96 =
keycode 97 =
keycode 98 =
keycode 99 =
keycode 100 =
keycode 101 =
keycode 102 =
keycode 103 =
keycode 104 =
keycode 105 =
keycode 106 =
keycode 107 =
keycode 108 =
keycode 109 =
keycode 110 =
keycode 111 = Up NoSymbol Up
keycode 112 =
keycode 113 = Left NoSymbol Left
keycode 114 = Right NoSymbol Right
keycode 115 =
keycode 116 = Down NoSymbol Down
keycode 117 =
keycode 118 =
keycode 119 =
keycode 120 =
keycode 121 =
keycode 122 =
keycode 123 =
keycode 124 =
keycode 125 =
keycode 126 =
keycode 127 =
keycode 128 =
keycode 129 =
keycode 130 =
keycode 131 =
keycode 132 =
keycode 133 = Super_L NoSymbol Super_L
keycode 134 =
keycode 135 =
keycode 136 =
keycode 137 =
keycode 138 =
keycode 139 =
keycode 140 =
keycode 141 =
keycode 142 =
keycode 143 =
keycode 144 =
keycode 145 =
keycode 146 =
keycode 147 =
keycode 148 =
keycode 149 =
keycode 150 =
keycode 151 =
keycode 152 =
keycode 153 =
keycode 154 =
keycode 155 =
keycode 156 =
keycode 157 =
keycode 158 =
keycode 159 =
keycode 160 =
keycode 161 =
keycode 162 =
keycode 163 =
keycode 164 =
keycode 165 =
keycode 166 =
keycode 167 =
keycode 168 =
keycode 169 =
keycode 170 =
keycode 171 =
keycode 172 =
keycode 173 =
keycode 174 =
keycode 175 =
keycode 176 =
keycode 177 =
keycode 178 =
keycode 179 =
keycode 180 =
keycode 181 =
keycode 182 =
keycode 183 =
keycode 184 =
keycode 185 =
keycode 186 =
keycode 187 =
keycode 188 =
keycode 189 =
keycode 190 =
keycode 191 =
keycode 192 =
keycode 193 =
keycode 194 =
keycode 195 =
keycode 196 =
keycode 197 =
keycode 198 =
keycode 199 =
keycode 200 =
keycode 201 =
keycode 202 =
keycode 203 =
keycode 204 =
keycode 205 =
keycode 206 =
keycode 207 =
keycode 208 =
keycode 209 =
keycode 210 =
keycode 211 =
keycode 212 =
keycode 213 =
keycode 214 =
keycode 215 =
keycode 216 =
keycode 217 =
keycode 218 =
keycode 219 =
keycode 220 =
keycode 221 =
keycode 222 =
keycode 223 =
keycode 224 =
keycode 225 =
keycode 226 =
keycode 227 =
keycode 228 =
keycode 229 =
keycode 230 =
keycode 231 =
keycode 232 =
keycode 233 =
keycode 234 =
keycode 235 =
keycode 236 =
keycode 237 =
keycode 238 =
keycode 239 =
keycode 240 =
keycode 241 =
keycode 242 =
keycode 243 =
keycode 244 =
keycode 245 =
keycode 246 =
keycode 247 =
keycode 248 =
keycode 249 =
keycode 250 =
keycode 251 =
keycode 252 =
keycode 253 =
keycode 254 =
keycode 255 =
so
Code:
 xmodmap .Xmodmap_null
would temp*ly disable the keyboard. the only keys that would work is Super_L, Esc, Up, Down, Left, Right, Alt_L, Tab . so even in disable mode i would still be able to switch between windows (hence the books) and scroll . keyboard can be revert back to normal mode by assigning an executable file (here change_xmodmap.sh) to a key combination (here Super_L + Esc).

change_xmodmap.sh
Code:
#!/bin/bash

file=~/.IsXmodmapNull

if [ -e $file ] ; then
	xmodmap ~/.Xmodmap
	rm $file
	notify-send "book-xmodmap disabled"
else
	xmodmap ~/.Xmodmap_null
	touch $file
	notify-send "book-xmodmap enabled"
fi
i was wondering if double keystroke like tap can be used as key combination ?

Quote:
Originally Posted by Soadyheid
If the notes you are taking are on loose paper (or will be fitted into a loose leaf binder) Buy a clip board and. with the laptop on the table, hold the clip board in one hand while writing notes with the other. The clip board can be laid on your lap/the floor or wherever while you use the laptop.
Use a hard backed notebook if loose leaf is not an option.
you really want to solve the problem from another angle.

Quote:
Originally Posted by H_TeXMeX_H
I would use xlock or xlockmore to lock the screen, that way you need to put in a password and that's unlikely to be entered with a book. It's not 100%, but the only 100% solution is to unplug the keyboard or stop putting a book on the keyboard.
i cant. i still want to read book and scroll through pages.

hope it helps rknichols.

thanks everyone.

Last edited by ununun; 12-09-2012 at 09:17 AM.
 
Old 12-09-2012, 09:49 AM   #9
TobiSGD
Moderator
 
Registered: Dec 2009
Location: Hanover, Germany
Distribution: Main: Gentoo Others: What fits the task
Posts: 15,653
Blog Entries: 2

Rep: Reputation: 4095Reputation: 4095Reputation: 4095Reputation: 4095Reputation: 4095Reputation: 4095Reputation: 4095Reputation: 4095Reputation: 4095Reputation: 4095Reputation: 4095
Quote:
Originally Posted by ununun View Post
i was wondering if double keystroke like tap can be used as key combination ?
Use a key combination that is very unlikely to be pressed by a book, like Ctrl+Alt+F12.

May be a dumb question, but if you want to make notes, why don't you just launch your favorite text editor and use the keyboard instead of disabling it? I for one can type faster that write with the hand and if your WM or DE has a scratchpad function (may be named different in other WMs/DEs as i3) it is very easy to show the editor only when needed (on any screen).
 
Old 12-09-2012, 10:03 AM   #10
ununun
Member
 
Registered: Jun 2011
Posts: 82

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by TobiSGD
Use a key combination that is very unlikely to be pressed by a book, like Ctrl+Alt+F12.
faster stroke is also very unlikely to be replicated by book and also its also very quick for me .

Quote:
Originally Posted by TobiSGD
May be a dumb question, but if you want to make notes, why don't you just launch your favorite text editor and use the keyboard instead of disabling it? I for one can type faster that write with the hand and if your WM or DE has a scratchpad function (may be named different in other WMs/DEs as i3) it is very easy to show the editor only when needed (on any screen).
not only i like the complexity that paper-pen provides but also i am math student . i did try to take notes in lyx for a while, but i did not like it very much. however for anything programming related i am most likely to use vim.

Last edited by ununun; 12-09-2012 at 10:05 AM.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Disable AND Enable Keyboard FROM the Keyboard pukster Linux - Hardware 2 02-09-2011 11:55 AM
Temporarily enable/disable keyboard Cyberman Linux - Hardware 1 07-26-2009 02:53 AM
[SOLVED] How to temporarily disconnect keyboard and mouse under X ? Linux.tar.gz Linux - Software 6 02-12-2009 08:22 AM
How to disable second keyboard in X? Jaa Linux - Desktop 0 08-22-2006 11:14 AM
how to disable keyboard tqa Linux - Hardware 3 06-17-2006 04:59 AM


All times are GMT -5. The time now is 07:28 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration