From: "Stephan Kämper" Date: 2005-02-08T04:25:12+09:00 Subject: Re: FXRuby - handling Alt+F4 Chris Morris wrote: > I'm trying to properly write a way to capture an Alt+F4 keystroke, and > I'm not finding the right constant for the Alt key. Here's what I've > currently got, and it works, but obviously isn't the 'correct' way to > && out the Alt key from the evt.state: > > if (evt.state == 24) && (evt.code == KEY_F4) > exit > else > ... > end > I did it by writing this: menu_bar = FXMenubar.new( self, LAYOUT_SIDE_TOP | LAYOUT_FILL_X ) file_menu = FXMenuPane.new( self ) FXMenuCommand.new( fileMenu, "&Quit\tALT-F4", nil, app, FXApp::ID_QUIT ) I'm sure there are ways to close an application without having a menu bar. Lyle? Happy rubying Stephan