Bind the four arrow keys to pan by the given fraction of the visible span.
(&mut self, fraction: f64)
| 311 | |
| 312 | /// Bind the four arrow keys to pan by the given fraction of the visible span. |
| 313 | pub fn bind_arrow_pan(&mut self, fraction: f64) -> &mut Self { |
| 314 | self.bind_key( |
| 315 | keyboard::Key::Named(keyboard::key::Named::ArrowLeft), |
| 316 | KeyAction::PanBy { |
| 317 | direction: PanDirection::Left, |
| 318 | fraction, |
| 319 | }, |
| 320 | ) |
| 321 | .bind_key( |
| 322 | keyboard::Key::Named(keyboard::key::Named::ArrowRight), |
| 323 | KeyAction::PanBy { |
| 324 | direction: PanDirection::Right, |
| 325 | fraction, |
| 326 | }, |
| 327 | ) |
| 328 | .bind_key( |
| 329 | keyboard::Key::Named(keyboard::key::Named::ArrowUp), |
| 330 | KeyAction::PanBy { |
| 331 | direction: PanDirection::Up, |
| 332 | fraction, |
| 333 | }, |
| 334 | ) |
| 335 | .bind_key( |
| 336 | keyboard::Key::Named(keyboard::key::Named::ArrowDown), |
| 337 | KeyAction::PanBy { |
| 338 | direction: PanDirection::Down, |
| 339 | fraction, |
| 340 | }, |
| 341 | ) |
| 342 | } |
| 343 | |
| 344 | /// Remove all arrow-key pan bindings. |
| 345 | pub fn unbind_arrow_pan(&mut self) -> &mut Self { |