473,789 Members | 2,781 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

IDLE dedent/unindent key bindings for non-us keybord?

Hi.

I use Idle 1.1.1 on Python 2.4.1.

The "Ctrl-[" and "Ctrl-]" key bindings for indenting do not work on
non-us keyboards where brackets are accessed by the "Alt Gr" key.

The Tab key seem to work for indenting a selected textblock on my
swedish keyboard, but Shift-tab does not dedent as you would have
expected.

If I try to redefine key bindings in "options->Configure IDLE->Keys" so
that Shift-Tab is bound to dedent, things seem to get really weird.

After creating a "Custom key set"
- the "Ok"-button does not close the options window, I have to use
"Cancel" to get out.

- Tab does not longer indent selected text, but replaces it with a tab
character instead.

- Shift->Tab does nothing.

- F5 for Run module does nothing

and so on.
What could be wrong here, and do you have any other suggestions for a
"dedent" key binding that may work on a non-us/swedish keyboard (or
maybe an alternative editor for python code).

Thanks.

Oct 2 '05 #1
1 3421
On 2 Oct 2005 08:52:53 -0700, gj*******@gmail .com wrote:
Hi.

I use Idle 1.1.1 on Python 2.4.1.

The "Ctrl-[" and "Ctrl-]" key bindings for indenting do not work on
non-us keyboards where brackets are accessed by the "Alt Gr" key.

The Tab key seem to work for indenting a selected textblock on my
swedish keyboard, but Shift-tab does not dedent as you would have
expected.

If I try to redefine key bindings in "options->Configure IDLE->Keys" so
that Shift-Tab is bound to dedent, things seem to get really weird.

After creating a "Custom key set"
- the "Ok"-button does not close the options window, I have to use
"Cancel" to get out.


I'v seen this also:
this must be a bug.
Exception in Tkinter callback
Traceback (most recent call last):
File "C:\Python24\li b\lib-tk\Tkinter.py", line 1345, in __call__
return self.func(*args )
File "C:\Python24\li b\idlelib\confi gDialog.py", line 1197, in Apply
self.ActivateCo nfigChanges()
File "C:\Python24\li b\idlelib\confi gDialog.py", line 1185, in
ActivateConfigC h
anges
instance.ResetK eybindings()
File "C:\Python24\li b\idlelib\Edito rWindow.py", line 585, in
ResetKeybinding s
self.apply_bind ings()
File "C:\Python24\li b\idlelib\Edito rWindow.py", line 837, in
apply_bindings
text.event_add( event, *keylist)
File "C:\Python24\li b\lib-tk\Tkinter.py", line 1299, in event_add
self.tk.call(ar gs)
TclError: bad event type or keysym "tab"
Exception in Tkinter callback
Traceback (most recent call last):
File "C:\Python24\li b\lib-tk\Tkinter.py", line 1345, in __call__
return self.func(*args )
File "C:\Python24\li b\idlelib\confi gDialog.py", line 1192, in Ok
self.Apply()
File "C:\Python24\li b\idlelib\confi gDialog.py", line 1197, in Apply
self.ActivateCo nfigChanges()
File "C:\Python24\li b\idlelib\confi gDialog.py", line 1185, in
ActivateConfigC h
anges
instance.ResetK eybindings()
File "C:\Python24\li b\idlelib\Edito rWindow.py", line 585, in
ResetKeybinding s
self.apply_bind ings()
File "C:\Python24\li b\idlelib\Edito rWindow.py", line 837, in
apply_bindings
text.event_add( event, *keylist)
File "C:\Python24\li b\lib-tk\Tkinter.py", line 1299, in event_add
self.tk.call(ar gs)
TclError: bad event type or keysym "tab"
next time, I start:

C:\Python24\Lib \idlelib>idle.p y
error reading package index file C:/Python24/tcl/tix8.1/pkgIndex.tcl:
invalid co
mmand name "lt}]}"
Traceback (most recent call last):
File "C:\Python24\Li b\idlelib\idle. py", line 21, in ?
idlelib.PyShell .main()
File "C:\Python24\li b\idlelib\PyShe ll.py", line 1355, in main
if not flist.open_shel l():
File "C:\Python24\li b\idlelib\PyShe ll.py", line 275, in open_shell
self.pyshell = PyShell(self)
File "C:\Python24\li b\idlelib\PyShe ll.py", line 793, in __init__
OutputWindow.__ init__(self, flist, None, None)
File "C:\Python24\li b\idlelib\Outpu tWindow.py", line 16, in __init__
EditorWindow.__ init__(self, *args)
File "C:\Python24\li b\idlelib\Edito rWindow.py", line 108, in __init__
self.apply_bind ings()
File "C:\Python24\li b\idlelib\Edito rWindow.py", line 837, in
apply_bindings
text.event_add( event, *keylist)
File "C:\Python24\li b\lib-tk\Tkinter.py", line 1299, in event_add
self.tk.call(ar gs)
_tkinter.TclErr or: bad event type or keysym "tab"

(On Windows)
I discovered, looking in C:\.idlerc\conf ig-keys.cfg

there was the entry
dedent-region = <Shift-Key-tab>

with an editor you can change it to uppercase:

dedent-region = <Shift-Key-Tab>

then it works again.

HTH
--
Franz Steinhaeusler
Oct 5 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
1783
by: Bartolomé Sintes Marco | last post by:
Hi, I have downloaded and installed Python 2.3 RC1 in a Windows 98 SE computer. IDLE 1.0 does not work very well: a) When I open with IDLE 1.0 RC1 a program written with IDLE 0.8, non-ASCII characters (like voyels with accents) are changed to wrong characters. b) If a program has non-ASCII characters, save or save as work when a new file is created, but if I open a file with non-ASCII characters and I modify it, then I can not save it...
699
34255
by: mike420 | last post by:
I think everyone who used Python will agree that its syntax is the best thing going for it. It is very readable and easy for everyone to learn. But, Python does not a have very good macro capabilities, unfortunately. I'd like to know if it may be possible to add a powerful macro system to Python, while keeping its amazing syntax, and if it could be possible to add Pythonistic syntax to Lisp or Scheme, while keeping all of the...
1
2112
by: Kamilche | last post by:
I had a problem starting IDLE today, and managed to fix it. I'm posting this for future reference. IDLE worked fine, up until I got bold and tried to set a key binding. When attempting to set the 'dedent region' keystring to shift-tab, the shell printed an error. Past that point, IDLE wouldn't start up. I deinstalled and reinstalled Python various times using various options, cleaned out the registry, and scoured the Internet. I had the...
15
7390
by: Ashot | last post by:
This is sort of both Python and Vim related (which is why I've posted to both newsgroups). Python related: ---------------------- I have been frustrated for quite some time with a lack of a history command in IDLE (in fact with IDLE in general). Often I'll develop new code at the command line, testing each line as I go. Currently I have to copy and paste, removing outputs and the ">>>" at each line. Is it perhaps possible to make...
0
1408
by: Brian van den Broek | last post by:
Hi all, IDLE refuses to launch, and I believe it is because I attempted to define a custom key-binding that it doesn't like. I was recently defining a custom keybinding in IDLE 1.1 under Python 2.4 on WinMe. (I was using the simpler of the two binding definition interfaces.) When done, I hit the buttons for 'OK' (or however it is labelled -- I cannot currently check), but the definition dialog remained open. After several tries, I hit...
6
2046
by: Steven Bethard | last post by:
So I've recently been making pretty frequent use of textwrap.dedent() to allow me to use triple-quoted strings at indented levels of code without getting the extra spaces prefixed to each line. I discovered today that not only does textwrap.dedent() strip any leading spaces, but it also substitutes any internal tabs with spaces. For example:: py> def test(): .... x = ('abcd efgh\n' .... 'ijkl mnop\n') .... y =...
15
2928
by: Tom Plunket | last post by:
The documentation for dedent says, "Remove any whitespace than can be uniformly removed from the left of every line in `text`", yet I'm finding that it's also modifying the '\t' characters, which is highly undesirable in my application. Is there any way to stop it from doing this, or alternatively, to put those tabs back in? I see that TextWrap and its member functions take an 'expand_tabs' kwarg, but dedent unfortunately does not. ...
3
389
by: rocco.rossi | last post by:
I'm using IDLE for my Python programming. I can't seem to solve one issue though. Whenever I try to indent a region of code, I simply select it and hit the tab key, as I usually do in most editors, like GEdit or Geany on Linux, for instance, and it works fine. But, if I try to unindent a region of code, which i would do by pressing Shift- Tab in other editors, it just won't work, and I can't find any combination that will. Anybody know...
7
1945
by: Adam W. | last post by:
I did a stupid thing and "wrote in" <Up-Arrowunder the advance key bindings section, and after hitting apply I got a load of exceptions. Now my shell wont open and my IDEL wont start anymore.... I uninstalled and reinstalled Python with no luck, the whacked settings must be lingering around somewhere. Its python 2.5.1 and its on Vista if that helps.
1
3028
by: wongjoekmeu | last post by:
Dear All, I have some functions written in C++, which I try to approach from python using swig. In the C++ functions I use std::cout to print stuff to output. Everything works fine, but the only problem that I have is that when I start IDLE and use the functions what std::cout should print to the "IDLE console" simply does not appear. When I don't use IDLE but simply double click on the .py script, it works all fine. I was wondering how...
0
9666
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9511
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
1
10139
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9984
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9020
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7529
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5418
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
4093
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
2909
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.