Kotlin: Accessing parameter of when-statement : <p>Is there a way to get the value of the expression I passed into the <code>when</code> statement?</p>

<p>In my application I have a <code>KeyListener</code> like that</p>

<pre><code>_content.addKeyListener(object : KeyAdapter() {
    override fun keyPressed(e: KeyEvent?) = when(e?.keyCode) {
        KeyEvent.VK_T -&gt; mainWindow.enterTrainingState()
        KeyEvent.VK_P -&gt; mainWindow.enterPlayState()
        KeyEvent.VK_E -&gt; mainWindow.close()
        else -&gt; println(e?.keyCode)
    }
})
</code></pre>

<p>Has Kotlin a neat syntax to access <code>e?.keyCode</code>? I don't really want to repeat the expression.</p>
