Flutter 패키지로 개발자가 애플리케이션 내에서 사용자 정의 및 전역 키보드 단축키를 구현할 수 있도록 합니다. 사용자는 키 조합을 사용하여 스크린 상단 또는 하단으로 자동 스크롤하는 등의 작업을 트리거할 수 있습니다. 이 패키지는 통합이 쉬우며, 단축키를 정의하고 관리하기 위한 간단한 위젯을 제공합니다. 로컬 및 글로벌 단축키 처리를 모두 지원하므로 생산성 중심 앱에 적합합니다. 개발자는 자체 단축키 로직을 정의함으로써 기능을 확장할 수 있습니다. 이 패키지는 오픈소스이며 GitHub에서 유지 보수됩니다.
사용 사례
내비게이션 단축키 구현
빠른 스크롤 작업 활성화
사용자 정의 핫키 추가
키보드 탐색을 통한 접근성 향상
효율적인 개발자 도구 만들기
주요 기능
사용자 정의 단축키 정의를 지원합니다
전역 및 로컬 단축키 처리
기존 위젯과의 간편한 통합
오픈소스이며 지속적으로 유지 관리되고 있습니다
단축키 관리를 위한 명확한 API 제공
적합한 대상
생산성 앱
개발자 도구
접근성 향상
콘텐츠 중심 인터페이스
빠른 탐색이 필요한 앱
고려 사항
시스템 수준의 단축키와 충돌할 수 있습니다
포커스 및 컨텍스트를 신중하게 다뤄야 합니다
모든 UI 패턴에 적합하지 않음
제한된 플랫폼별 사용자 지정
다양한 입력 방법에서 테스트가 필요합니다
원본 README
연결된 소스 저장소의 README 원문 스냅샷입니다. 최신 내용은 저장소에서 확인하세요.
Flutter Keyboard Shortcuts
Keyboard shortcuts to add where you want
Example
On controlLeft + key P are pressed, user navigate to SecondPage()
helpLabel will be display on help menu
KeyBoardShortcuts(
keysToPress: {LogicalKeyboardKey.controlLeft, LogicalKeyboardKey.keyP},
onKeysPressed: () => Navigator.push(
context,
MaterialPageRoute(builder: (context) => SecondPage()),
),
helpLabel: "Go to Second Page",
child: Center(
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[
Text(
'You have pushed the button this many times:',
),
Text(
'$_counter',
style: Theme.of(context).textTheme.headline4,
),
],
),
),
),
If globalShortcuts is set to true, user can use Home Button to go on Homepage, up and down button to go on top or bottom of the page and escape to go on last page
KeyBoardShortcuts(
globalShortcuts: true,
child: Center(
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[
Text(
'You have pushed the button this many times:',
),
Text(
'$_counter',
style: Theme.of(context).textTheme.headline4,
),
],
),
),
),
initShortCuts() is used to customize shortcuts, you can set home page, title of help menu, icon on custom shortcuts and custom help menu
You can also use initShortCuts to create your own global shortcuts, they will be allow in all page were globalShortcuts is true without rewriting these shortcuts