Q:

How do I consume a key event in Scala reactions

Suppose there is a "reactions" block such as
this.reactions += {
  case KeyReleased(src, key, mod, _) => {
  // do some stuff
  // but how to consume this KeyEvent?? 
  }
}

After doint "some stuff" I want to consume the KeyEvent, but I do not know how.  Looking into sources on Component.scala I have found how the KeyReleased event is constructed:
object keys extends Publisher {
  peer.addKeyListener(new KeyListener {
    def keyPressed(e: java.awt.event. KeyEvent) { publish(new KeyPressed(e)) }
    def keyReleased(e: java.awt.event. KeyEvent) { publish(new KeyReleased(e)) }
    def keyTyped(e: java.awt.event. KeyEvent) { publish(new KeyTyped(e)) }
  })
}

The java.awt.event. KeyEvent is used as a constructor parameter, but the KeyReleased case class has this signature
case class KeyReleased(val source: Component, key: Key. Value, val modifiers: Key. Modifiers, 
                location: Key. Location. Value)
               (val peer: java.awt.event. KeyEvent) extends KeyEvent {
def this(e: java.awt.event. KeyEvent) = 
this(UIElement.cachedWrapper[Component](e.getSource.asInstanceOf[JComponent]), 
    Key(e.getKeyCode), e.getModifiersEx, Key. Location(e.getKeyLocation))(e) 
}

and therefore I cannot access the KeyEvent parameter. 

A:

You don't have to unpack the KeyReleased event in the case statement reaction.  Just matching on the Event itself will allow you to call consume on it. 
reactions += {
    case e: KeyReleased => {
        println(e.source, e.key, e.modifiers)
        e.consume
    }
}

