diff --git a/ShadowsocksX-NG/AppDelegate.swift b/ShadowsocksX-NG/AppDelegate.swift index bc3df8f..470d9ff 100755 --- a/ShadowsocksX-NG/AppDelegate.swift +++ b/ShadowsocksX-NG/AppDelegate.swift @@ -595,6 +595,15 @@ class AppDelegate: NSObject, NSApplicationDelegate, NSUserNotificationCenterDele item.title = profile.title() item.state = (mgr.activeProfileId == profile.uuid) ? .on : .off item.isEnabled = profile.isValid() + // Use number keys for faster switch between the first 10 servers from main menu + if i < 10 { + var key = i + 1 + if key == 10 { + key = 0 + } + item.keyEquivalent = String(key) + item.keyEquivalentModifierMask = .init() + } item.action = #selector(AppDelegate.selectServer) menu.insertItem(item, at: beginIndex)