Re: [Pythonmac-SIG] Key Bindings on cross platform apps.

2008-02-04 Thread Tom Pollard

On Feb 4, 2008, at 2:26 PM, Christopher Barker wrote:
 I've found that most apps these days follow the same convention for  
 the really
 standard stuff -- cut/copy/paste, save, except that the Mac uses
 command where Windows and Linux (which is to say KDE, GNOME, and
 Mozilla) use control -- why apple ever even added a control key,
 rather than making command==control, I'll never know. But there you  
 go.

My recollection is that the control key has been around since the  
stone ages (ASR-33 teletypes, at least) and that many of the standard  
control-key combinations (ctl-C, for one) had their well-defined  
meanings long before the Mac was introduced.  For Apple to introduce a  
command key rather than saying ctl-c no longer meant 'interrupt' but  
now 'copy' makes sense.  That MS (or IBM, or whoever) decided to start  
using ctl-key combinations to mirror Apple's cmd-key combinations  
seems like the more egregious offense.  (If I'm misremembering the  
history, please correct me.)

Tom

___
Pythonmac-SIG maillist  -  Pythonmac-SIG@python.org
http://mail.python.org/mailman/listinfo/pythonmac-sig


Re: [Pythonmac-SIG] Key Bindings on cross platform apps.

2008-02-04 Thread Christopher Barker
Nehemiah Dacres wrote:
  What is the difference between this editor and editra

The big difference is that Peppy has been designed to be more flexible 
and expendable -- I think it has the potential to be a really great 
editor for ALL types of text files (and some others -- binary, etc.). 
Some of the key features:

  - user-definable key bindings, including emacs style multi-key bindings.

  - User definable major-modes for different file types. (and I think 
they are inheritable, so you could create one that was almost like an 
existing mode, then add/change a bit for your use.

  - Minor modes -- these are kind of like mix-ins -- extra functionality 
you can tack onto various major modes -- like word wrapping etc.

  - You can view the same buffer (file) in multiple windows at the same 
time.

Is does currently lack a bit of polish, particularly on the Mac.


Editra (and PyPE, SPE, ulipad, etc), on the other hand has been 
built to do what it does well, but without the built-in flexibility. No 
different modes, no user-definable key bindings, etc. It does work 
better for the basic stuff out-of-the-box, but I've bumped into limits 
already with it.

In short, the developers have taken a different tack -- Peppy has been 
designed from the ground up with a focus on getting a flexible (and 
admittedly complex) framework in place, with some of the usability 
details on the back burner. Editra, on the other hand, has focused on 
getting basic functionality in place, including the usability niceties. 
This does make early version more usable, but I think, in the long run, 
Peppy has more room to grow.

  and is there any
  possibility that i would be able to use this via a console?

I think there is a possibility in the future that a console mode could 
be built -- it's got good separation of functionality from UI, but there 
  is only a wx UI at the moment -- I don't think he has plans for a 
console version.

-Chris

PS: Peppy is the only editor other than (X)emacs that has a python mode 
that does indentation right.

-Chris


-- 
Christopher Barker, Ph.D.
Oceanographer

Emergency Response Division
NOAA/NOS/ORR(206) 526-6959   voice
7600 Sand Point Way NE   (206) 526-6329   fax
Seattle, WA  98115   (206) 526-6317   main reception

[EMAIL PROTECTED]
___
Pythonmac-SIG maillist  -  Pythonmac-SIG@python.org
http://mail.python.org/mailman/listinfo/pythonmac-sig


Re: [Pythonmac-SIG] Key Bindings on cross platform apps.

2008-02-04 Thread Nicholas Riley
On Mon, Feb 04, 2008 at 02:52:43PM -0500, Tom Pollard wrote:
 My recollection is that the control key has been around since the  
 stone ages (ASR-33 teletypes, at least) and that many of the standard  
 control-key combinations (ctl-C, for one) had their well-defined  
 meanings long before the Mac was introduced.  For Apple to introduce a  
 command key rather than saying ctl-c no longer meant 'interrupt' but  
 now 'copy' makes sense.  That MS (or IBM, or whoever) decided to start  
 using ctl-key combinations to mirror Apple's cmd-key combinations  
 seems like the more egregious offense.  (If I'm misremembering the  
 history, please correct me.)

That's more or less it.  The Apple II had a Control key before it had
open/closed-Apple (Command/Option) keys.  The Mac Plus and earlier had
only Command-Option keys and no Control (or Escape) key, which made
terminal emulation software rather unhappy - they typically used the
Option key.  The Apple IIgs and Mac SE/II were the first machines to
get ADB, and thus keyboard compatibility between the two.  The other
II/Mac unification changes were the Escape key, renaming Backspace
to Delete and adding the (open) Apple logo to the Command key, from
which it was only recently removed.

Apple had three ADB keyboards at that point:

- the Apple Extended keyboard, the basis of every desktop Apple
  keyboard since, until the recent aluminum keyboard design
  http://en.wikipedia.org/wiki/Image:Apple_Extended_Keyboard.jpg

- the Apple Standard keyboard, with Control to the left of A, caps
  lock at the bottom left, escape to the left of 1 and arrow keys in
  order: http://en.wikipedia.org/wiki/Image:Apple_ADB_Keyboard.jpg

- the IIgs keyboard, which was essentially a smaller version of the
  Apple Standard keyboard (and came out first):
  http://en.wikipedia.org/wiki/Image:Apple_IIgs_Keyboard_B.jpg

The Extended keyboard was designed to be infrequently purchased, only
by those people who wanted to run PC software on their Macs (Apple
also shipped a 5 1/4 drive to be used with Macintosh PC Exchange
around the same time), but it ended up becoming the dominant keyboard.

-- 
Nicholas Riley [EMAIL PROTECTED] | http://www.uiuc.edu/ph/www/njriley
___
Pythonmac-SIG maillist  -  Pythonmac-SIG@python.org
http://mail.python.org/mailman/listinfo/pythonmac-sig


Re: [Pythonmac-SIG] Key Bindings on cross platform apps.

2008-02-04 Thread Christopher Barker
Jack Jansen wrote:
 There are some apps that have sets of keyboard shortcuts and let you 
 switch between them with a preference. 

Yes, and Peppy is one of them -- one of it's strengths.

 This is very handy, because now a 
 Mac user of application X can chose whether s/he wants Mac-oriented 
 shortcuts (so find will be command-F, for example) and another user of X 
 on the Mac who happens to be familiar with the Windows version of X can 
 chose Windows-X-compatible shortcuts (so find would be F3, probably).

Right. I switch a lot between OS-X, Windows, and Linux a lot. I've found 
that most apps these days follow the same convention for the really 
standard stuff -- cut/copy/paste, save, except that the Mac uses 
command where Windows and Linux (which is to say KDE, GNOME, and 
Mozilla) use control -- why apple ever even added a control key, 
rather than making command==control, I'll never know. But there you go.

Anyway, to help with that confusion, I've re-mapped my Mac keyboard so that:

key  action
___
command   == command
control   == command
caps lock == control

Since CapsLock is evil anyway, I've remapped it to control on Windows 
and Linux also, so I can do the same thing everywhere.

As far as Peppy is concerned, what I want is to have it behave the same 
on all platforms, except using the command key instead of control on 
OS-X. There are two options for doing this:

1) enforce that command==control in Peppy. This is what wx does by 
default if you use the right constants to define your keys

2) have a Mac keyboard mapping that is different than the other ones.

I prefer the 1st approach -- it makes it easier have a default set of 
key bindings that is the same everywhere, and easier to move a key 
bindings config file between platforms. I was polling this group to see 
if that approach made sense to others too. It seems it does.

 I don't like customizable keyboard shortcuts in general (this is what 
 makes it impossible to type anything in someone else's Emacs, for 
 example),

I agree -- I found the default emacs bindings painful enough that I've 
added my own, but now I can hardly use emacs if I don't have my own 
config for it.

-Chris

-- 
Christopher Barker, Ph.D.
Oceanographer

Emergency Response Division
NOAA/NOS/ORR(206) 526-6959   voice
7600 Sand Point Way NE   (206) 526-6329   fax
Seattle, WA  98115   (206) 526-6317   main reception

[EMAIL PROTECTED]
___
Pythonmac-SIG maillist  -  Pythonmac-SIG@python.org
http://mail.python.org/mailman/listinfo/pythonmac-sig


Re: [Pythonmac-SIG] Key Bindings on cross platform apps.

2008-02-03 Thread Jack Jansen


On  1-Feb-2008, at 23:55 , Christopher Barker wrote:


Hi all

I'm trying help out Rob McMullen get his Peppy editor working  
well on

OS-X. I'm thinking about about key bindings.


There are some apps that have sets of keyboard shortcuts and let you  
switch between them with a preference. This is very handy, because  
now a Mac user of application X can chose whether s/he wants Mac- 
oriented shortcuts (so find will be command-F, for example) and  
another user of X on the Mac who happens to be familiar with the  
Windows version of X can chose Windows-X-compatible shortcuts (so  
find would be F3, probably).


I don't like customizable keyboard shortcuts in general (this is what  
makes it impossible to type anything in someone else's Emacs, for  
example), but in this one case I think it's definitely worth it.

--
Jack Jansen, [EMAIL PROTECTED], http://www.cwi.nl/~jack
If I can't dance I don't want to be part of your revolution -- Emma  
Goldman



___
Pythonmac-SIG maillist  -  Pythonmac-SIG@python.org
http://mail.python.org/mailman/listinfo/pythonmac-sig


[Pythonmac-SIG] Key Bindings on cross platform apps.

2008-02-01 Thread Christopher Barker
Hi all

I'm trying help out Rob McMullen get his Peppy editor working well on 
OS-X. I'm thinking about about key bindings.

Apple has the command key, but also an alt(option) key and a 
control key. I kind of wish they had never introduced a control key, 
but so be it.

Anyway, it seems that for the standard conventions, like cut, copy, 
paste, save, etc, that Macintosh apps use the command key where 
Windows (and KDE and GNOME) apps use the control key. This, for cross 
platform apps, this is what I think should be done:

On the Mac, the default behavior should be for command to do 
everything that control does on Windows and Linux, and control 
should do nothing. The alt(option) key should do the same thing as alt 
on the other platforms.

This seems like it makes for the best compatibility. Is this a standard 
and good way to do it?

thanks,
  -Chris

PS: A plug for Peppy:

Peppy is yet another text editor written with wxPython. When it first 
came out, I though arrggg! why another one?. But it turns out that the 
author's reasons for another one pretty much exactly match my reasons 
for never fully adopting any of the others -- they simple weren't 
designed to be as powerful and flexible as I need to make it my 
do-everything editor.

I've been looking for years for an editor that meets these requirements:

- Runs the same way on Linux, Windows, and OS-X
- Works well for editing all the kinds of text I need to edit -- with 
customized modes for all of them (Or the ability to create such modes)
- Good python support
- Modern UI (all the standard keystrokes, etc), and integration with 
the OS (drag and drop, etc)
- Scriptable in Python, so I can add the stuff it doesn't have.
- Multiple top-level windows.

In a nutshell, I want (X)emacs with a modern UI, and scriptable in python.

Rob has set out to build exactly that, and I think he has done an 
admirable job of creating the kind of flexible, powerful framework 
that's required to really make it shine.

It's still rough around the edges (particularly on the Mac -- I'm his 
only Mac user right now, and he doesn't have a Mac), but it would be 
great if some other folks could check it out and help clean up those 
rough edges. I urge you to give it a try.

http://peppy.flipturn.org/

getting the SVN version is probably your best bet. I just added a 
setup_mac.py file that you can build an alias application bundle with:

python setup_mac.py py2app -A

I haven't yet tested a full app bundle, but it works pretty well with 
the Alias mode.

-Chris


-- 
Christopher Barker, Ph.D.
Oceanographer

Emergency Response Division
NOAA/NOS/ORR(206) 526-6959   voice
7600 Sand Point Way NE   (206) 526-6329   fax
Seattle, WA  98115   (206) 526-6317   main reception

[EMAIL PROTECTED]
___
Pythonmac-SIG maillist  -  Pythonmac-SIG@python.org
http://mail.python.org/mailman/listinfo/pythonmac-sig


Re: [Pythonmac-SIG] Key Bindings on cross platform apps.

2008-02-01 Thread Robin Dunn
Christopher Barker wrote:
 Hi all
 
 I'm trying help out Rob McMullen get his Peppy editor working well on 
 OS-X. I'm thinking about about key bindings.
 
 Apple has the command key, but also an alt(option) key and a 
 control key. I kind of wish they had never introduced a control key, 
 but so be it.
 
 Anyway, it seems that for the standard conventions, like cut, copy, 
 paste, save, etc, that Macintosh apps use the command key where 
 Windows (and KDE and GNOME) apps use the control key. This, for cross 
 platform apps, this is what I think should be done:
 
 On the Mac, the default behavior should be for command to do 
 everything that control does on Windows and Linux, and control 
 should do nothing. The alt(option) key should do the same thing as alt 
 on the other platforms.
 
 This seems like it makes for the best compatibility. Is this a standard 
 and good way to do it?

A lot of this can be automated in wxPython by following some basic 
rules.  First of all wxMac will automatically convert Ctrl-whatever 
accelerators in menu items to be Command-whatever, so for example if 
somebody writes the app on Windows and uses Ctrl-C for the Copy menu 
accelerator then when it runs on Mac it will be turned into a Cmd-C. 
For other key bindings, such as those handled in explicit EVT_KEY_DOWN 
event handlers you can use the CmdDown() method in the key event object 
instead of MetaDown() on Mac and ControlDown() on the other platforms. 
CmdDown is simply defined like this:

 bool CmdDown() const
 {
#if defined(__WXMAC__) || defined(__WXCOCOA__)
 return MetaDown();
#else
 return ControlDown();
#endif
 }

For explicit accelerator tables there is a wx.ACCEL_CMD identifier that 
works the same way, it's equivalent to wx.ACCEL_CTRL on Windows and GTK 
and to the command key on Mac.

-- 
Robin Dunn
Software Craftsman
http://wxPython.org  Java give you jitters?  Relax with wxPython!

___
Pythonmac-SIG maillist  -  Pythonmac-SIG@python.org
http://mail.python.org/mailman/listinfo/pythonmac-sig


Re: [Pythonmac-SIG] Key Bindings on cross platform apps.

2008-02-01 Thread Christopher Barker
Robin Dunn wrote:
 Christopher Barker wrote:
 On the Mac, the default behavior should be for command to do 
 everything that control does on Windows and Linux, and control 
 should do nothing. The alt(option) key should do the same thing as alt 
 on the other platforms.

 This seems like it makes for the best compatibility. Is this a standard 
 and good way to do it?
 
 A lot of this can be automated in wxPython by following some basic 
 rules.

Thanks Robin, I knew some of that, mostly because a remarkable number of 
apps do just work. However:

- I wanted to confirm that I had the right goal -- it's obviously the 
way to do it to me, but I might have missed some Mac convention I don't 
know about.

- Peppy is doing some weird things with key bindings, in order to allow 
people to totally customize them, and to allow emacs-style multi-stroke 
bindings -- Ctrl-X Ctrl-O for file open, for instance. It's now mostly 
working, but not quite, so as I set out to debug, I want to make sure 
I've got the goals right!

Thanks,
  -Chris


-- 
Christopher Barker, Ph.D.
Oceanographer

Emergency Response Division
NOAA/NOS/ORR(206) 526-6959   voice
7600 Sand Point Way NE   (206) 526-6329   fax
Seattle, WA  98115   (206) 526-6317   main reception

[EMAIL PROTECTED]
___
Pythonmac-SIG maillist  -  Pythonmac-SIG@python.org
http://mail.python.org/mailman/listinfo/pythonmac-sig


Re: [Pythonmac-SIG] Key Bindings on cross platform apps.

2008-02-01 Thread Boyd Waters
Chris:

FWIW Qt has addressed this with QtKeySequence, there is a table of key  
bindings for standard keys here:

http://doc.trolltech.com/4.2/qkeysequence.html#details

Note that this table may be confusing:

 On Mac OS X, references to Ctrl, Qt::CTRL, Qt::Control and  
 Qt::ControlModifier correspond to the Command keys on the Macintosh  
 keyboard, and references to Meta,Qt::META, Qt::Meta and  
 Qt::MetaModifier correspond to the Control keys. Developers on Mac  
 OS X can use the same shortcut descriptions across all platforms,  
 and their applications will automatically work as expected on Mac OS  
 X.

Still, it's worth a look...

  - boyd

___
Pythonmac-SIG maillist  -  Pythonmac-SIG@python.org
http://mail.python.org/mailman/listinfo/pythonmac-sig