Tk Source Code

View Ticket
Login
Ticket UUID: 1233009
Title: Return and enter the same in callback
Type: Bug Version: obsolete: 8.4.11
Submitter: setok Created on: 2005-07-05 20:51:56
Subsystem: 01. Bindings Assigned To: das
Priority: 5 Medium Severity:
Status: Closed Last Modified: 2026-10-22 17:22:34
Resolution: Fixed Closed By: serhiy.storchaka
    Closed on: 2026-10-10 10:44:52
Description:
When using [bind] and giving the callback the keysym substitution 
(%K) Return and Enter both give a result of Return. This happens 
at least on OS X but I heard it also happens on Windows.
User Comments: serhiy.storchaka added on 2026-10-10 10:44:34:

On macOS the keypad Enter key reports KP_Enter since [15a8ae9787] (8.6.11), so it can be distinguished from Return. On Windows it is still reported as Return with the Extended modifier (TIP #158); this is tracked in [787402ffff].


kennykb added on 2007-11-01 05:16:46:
Logged In: YES 
user_id=99768
Originator: NO

I have no idea what to do about this on MacOSX.  On Windows, what we do is definitely to be considered deprecated, since on Windows keyboards, the Enter key on the keyboard and the one on the numeric pad are labeled alike.  Distinguishing them in documentation would be extremely challenging.  Any ideas, Daniel?

dgp added on 2007-11-01 00:40:06:
Logged In: YES 
user_id=80530
Originator: NO


status?

setok added on 2005-07-06 17:23:00:
Logged In: YES 
user_id=137542

Whatever the model, it should be kept basically the same for
all platforms (where it makes sense). I just hate
platform-dependencies, especially when it is unnecessary.
With MacOS Return and Enter usually act the same, but there
are applications where this is not so. I reckon it is
slightly more acceptable on MacOS than with Windows as even
Macintosh laptops have a separate Enter key in addition to
Return.

Perhaps Macs should use the UNIX model and support KP_Enter.

dkf added on 2005-07-06 15:06:13:
Logged In: YES 
user_id=79902

IOW, 8.5 (at least on Windows) distinguishes between the two
keys by way of a modifier flag (i.e. something you should
normally ignore). Leaving open because it's not clear to me
(as a non-Mac user) whether the Mac behaves the same in 8.5
or not.

jenglish added on 2005-07-06 05:03:27:
Logged In: YES 
user_id=68433

See also: TIP #158: Distinguish the two 'Enter' keys on Windows
http://www.tcl.tk/cgi-bin/tct/tip/158.html