overloading SEL_KEYPRESS

Or something like that…

The idea is to get some widget to do not only what it’s supposed to, but also something else. For example, I would really want to hear the buzzing sound of a fly whenever I press Ctrl-z in some FXText.

require 'fox16'
require 'fox16/responder' # no longer needed
include Fox

class BuzzingText < FXText
  include Responder

  def initialize p
    super p

  def onKeyPress sender, sel, event
    super sender, sel, event
    if (event.state & CONTROLMASK != 0) and (event.code == KEY_z)
      # buzz