mirror of
https://github.com/ClassiCube/ClassiCube.git
synced 2025-09-15 02:25:32 -04:00
Pressing the Enter key now works in place of clicking sign in buttons and connect buttons, addresses #35.
This commit is contained in:
parent
d053a3bf90
commit
74bb737593
@ -40,7 +40,29 @@ namespace Launcher {
|
||||
cc.Filter = e =>
|
||||
e.Name.IndexOf( txtCCSearch.Text, StringComparison.OrdinalIgnoreCase ) >= 0
|
||||
&& ( cbCCHideEmpty.Checked ? e.Players[0] != '0' : true );
|
||||
KeyPreview = true;
|
||||
KeyDown += KeyDownHandler;
|
||||
}
|
||||
|
||||
void KeyDownHandler(object sender, KeyEventArgs e) {
|
||||
if( e.KeyCode != Keys.Enter ) return;
|
||||
|
||||
if( tabs.SelectedTab == tabLocal ) {
|
||||
BtnLanConnectClick( null, null );
|
||||
} else if( tabs.SelectedTab == tabMinecraftNet ) {
|
||||
if( tabMC.SelectedTab == tabMCSignIn )
|
||||
mc.DoSignIn();
|
||||
else if( tabMC.SelectedTab == tabMCServers )
|
||||
mc.ConnectToServer();
|
||||
} else if( tabs.SelectedTab == tabClassicubeNet ) {
|
||||
if( tabCC.SelectedTab == tabCCSignIn )
|
||||
cc.DoSignIn();
|
||||
else if( tabCC.SelectedTab == tabCCServers )
|
||||
cc.ConnectToServer();
|
||||
}
|
||||
e.Handled = true;
|
||||
}
|
||||
|
||||
GameState mc, cc;
|
||||
|
||||
void DisplayResourcesDialog( object sender, EventArgs e ) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user