*

Welcome, Guest. Please login or register.

Get your own OLPC - Buy an XO laptop on eBay!
Pages: [1]
Print
Author Topic: Enabling ctrl-s  (Read 15283 times)

Enabling ctrl-s

dsiegel
New

Posts: 4


January 14, 2008, 02:03:50 AM

Sugar steals ctrl-s, for use as a global keep (save) key. This is particularly irritating to those of us who use emacs. To get ctrl-s back, in file:

/usr/lib/python2.5/site-packages/sugar/activity.py

comment out the line:

self.connect("key_press_event", self.__key_press_event_cb)

and reboot.
Logged

#1 Re: Enabling ctrl-s

SteveH
Commenter

Posts: 20


January 14, 2008, 05:58:41 AM

It also steals ctrl-O to switch to the Journal, which interferes with opening local files in Opera using a keystroke.

Thanks for posting this. I'm going to look for the ctrl-O keystroke, too!
Logged

#2 Re: Enabling ctrl-s

unrequited
Senior Contributor
**
Posts: 120



January 14, 2008, 12:46:29 PM

Any way we could up and get rid of all the sugar shortcuts like CTRL-O, ALT-F, etc.?
Logged

-Unrequited

#3 Re: Enabling ctrl-s

Ben James Ben
Senior Contributor
**
Posts: 142



January 14, 2008, 03:15:09 PM

I suppose you could edit /usr/share/sugar/shell/view/keyhandler.py since that is where Ctrl-o, Alt-f, etc. are defined. Removing or commenting out the desired lines should do the trick:

Code:
  34 _actions_table = {
  35     'F1'             : 'zoom_mesh',
  36     'F2'             : 'zoom_friends',
  37     'F3'             : 'zoom_home',
  38     'F4'             : 'zoom_activity',
  39     'F9'             : 'brightness_down',
  40     'F10'            : 'brightness_up',
  41     '<ctrl>F9'       : 'brightness_min',
  42     '<ctrl>F10'      : 'brightness_max',
  43     'F11'            : 'volume_down',
  44     'F12'            : 'volume_up',
  45     '<ctrl>F11'      : 'volume_min',
  46     '<ctrl>F12'      : 'volume_max',
  47     '<alt>1'         : 'screenshot',
  48     '<alt>f'         : 'frame',
  49     '0x93'           : 'frame',
  50     '<alt>o'         : 'overlay',
  51     '0xE0'           : 'overlay',
  52     '0xEB'           : 'rotate',
  53     '<alt>r'         : 'rotate',
  54     '<alt>q'         : 'quit_emulator',
  55     '<alt>Tab'       : 'next_window',
  56     '<alt>n'         : 'next_window',
  57     '<ctrl><alt>Tab' : 'previous_window',
  58     '<alt>p'         : 'previous_window',
  59     '<ctrl>Escape'   : 'close_window',
  60     '<ctrl>q'        : 'close_window',
  61     '0xDC'           : 'open_search',
  62     '<ctrl>o'        : 'open_search',
  63     '<alt>s'         : 'say_text'
  64 }
Logged

#4 Re: Enabling ctrl-s

unrequited
Senior Contributor
**
Posts: 120



January 14, 2008, 08:26:02 PM

That was terrific. Thanks.
Logged

-Unrequited

#5 Re: Enabling ctrl-s

SteveH
Commenter

Posts: 20


January 15, 2008, 06:18:59 AM

Thanks. I was able to comment out the line that prevented me from using ctrl-O in nano to save my changes. It took effect after I restarted Sugar with the ctrl-alt-erase keystroke.

The section of code you quoted also lists shortcuts for setting volume and screen brightness to their minimum and maximum levels -- holding down the ctrl key while pressing the volume down key will mute the machine, for instance.

I'm also considering adding some shortcuts -- perhaps to launch Opera or the terminal.
Logged

#6 Re: Enabling ctrl-s

CatMoran
Senior Contributor
**
Posts: 168


WWW
January 15, 2008, 10:01:02 AM

I'm also considering adding some shortcuts -- perhaps to launch Opera or the terminal.

If you figure out the command to do that, could you post it? Figuring out a shortcut to launch Terminal is on my to-do list... somewhere...  Cheesy
Logged

#7 Re: Enabling ctrl-s

placain
Commenter

Posts: 12


January 20, 2008, 09:38:49 AM

Figuring out a shortcut to launch Terminal is on my to-do list... somewhere...  Cheesy

You'll like this: http://xo.cutup.org/quake-terminal.txt

That maps Control-down to bring up a terminal (with tabs!)
Logged

#8 Re: Enabling ctrl-s

CatMoran
Senior Contributor
**
Posts: 168


WWW
January 20, 2008, 01:06:15 PM

You'll like this: http://xo.cutup.org/quake-terminal.txt

That maps Control-down to bring up a terminal (with tabs!)

Very cool, thanks!
Logged

#9 Re: Enabling ctrl-s

baloo22
Commenter

Posts: 10


January 23, 2008, 10:14:12 AM


Just a note for letting you know that wiki.laptop.org explained that when the ctrl-something is used by the os you can do esc-esc and the key and it will work,,,

so double esc + the desired key will make what the ctrl- key was supposed to do in the apps.

look here: they explained it with the nano software...

http://wiki.laptop.org/go/Nano


"Usage Tips

    * Although ctrl-key combinations are listed for all commands, you can use the Escape key (black circled x) as a substitute for combinations that Sugar reserves for other purposes, such as CTRL-O for WriteOut (file save, represented as ^O on the nano menu). Instead, press Escape twice, then the letter O. The usual WriteOut "File Name to Write:" prompt will appear. "

Logged

#10 Re: Enabling ctrl-s

OtherMichael
Contributor
*
Posts: 39



WWW
May 23, 2008, 01:58:00 PM

Quote
Sugar steals ctrl-s, for use as a global keep (save) key. This is particularly irritating to those of us who use emacs. To get ctrl-s back, in file:

/usr/lib/python2.5/site-packages/sugar/activity.py

I'm using build 656 and I found the path to be one more level deep:

/usr/lib/python2.5/site-packages/sugar/activity/activity.py
Logged

#11 Re: Enabling ctrl-s

Rediscover
New

Posts: 1


May 27, 2008, 10:33:37 AM

build 703
escape key was getting stolen in Terminal activity, making
my emacs and vi sessions hurt.  ( <esc> displays the toolbar /
toolbox)
Probably not the most correct, but...

--- /usr/lib/python2.5/site-packages/sugar/graphics/window.py-  2007-11-02 12:00:00.000000000 +0000
+++ /usr/lib/python2.5/site-packages/sugar/graphics/window.py   2008-05-26 19:59:25.000000000 +0000
@@ -211,7 +211,8 @@
                 self.tray.props.visible = not self.tray.props.visible
                 return True
         elif key == 'Escape' and self._is_fullscreen and \
-            self.props.enable_fullscreen_mode:
+            self.props.enable_fullscreen_mode and \
+            service_name is not org.laptop.Terminal:
             self.unfullscreen()
             return True
         return False
[olpc@xo-10-B6-89 ~]$
Logged
Pages: [1]
Print
Jump to:  

Members
Total Members: 2406
Latest: sembik
Stats
Total Posts: 31943
Total Topics: 3843
Online Today: 25
Online Ever: 238
(April 18, 2011, 09:48:50 PM)
Users Online
Users: 0
Guests: 22
Total: 22