O'Reilly logo

Practical Programming in Tcl & Tk, Third Edition by Brent B. Welch

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Virtual Events

A virtual event corresponds to one or more event sequences. When any of the event sequences occurs, then the virtual event occurs. The next example shows the default virtual events for each platform:

Example 26-4 Virtual events for cut, copy, and paste.
switch $tcl_platform(platform) {
    "unix" {
      event add <<Cut>> <Control-Key-x> <Key-F20>
      event add <<Copy>> <Control-Key-c> <Key-F16>
      event add <<Paste>> <Control-Key-v> <Key-F18>
   }
   "windows" {
      event add <<Cut>> <Control-Key-x> <Shift-Key-Delete>
      event add <<Copy>> <Control-Key-c> <Control-Key-Insert>
      event add <<Paste>> <Control-Key-v> <Shift-Key-Insert>
   }
   "macintosh" {
      event add <<Cut>> <Control-Key-x> <Key-F2>
      event add <<Copy>> <Control-Key-c> <Key-F3>
      event add <<Paste>> <Control-Key-v> ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required