// Down transmits a press (key-down) event for the given Keycode.
//
// The host will interpret the key as being held down continuously until a
// corresponding release (key-up) event is transmitted, e.g., via method Up().
//
// See godoc comment on method Press() for details on what input is accepted and
// how it is interpreted.
Down transmits a press (key-down) event for the given Keycode.

The host will interpret the key as being held down continuously until a
corresponding release (key-up) event is transmitted, e.g., via method Up().

See godoc comment on method Press() for details on what input is accepted and
how it is interpreted.
// Down transmits a press ( key - down ) event for the given Keycode . // // The host will interpret the key as being held down continuously until a // corresponding release ( key - up ) event is transmitted e . g . via method Up () . // // See godoc comment on method Press () for details on what input is accepted and // how it is interpreted .
func (kb *Keyboard) Down(c Keycode) error {
	var res uint8
	msb := c >> 8
	if msb >= 0xC2 {
		if msb < 0xE0 {
			c = ((msb & 0x1F) << 6) | Keycode(c.key())
		} else {
			switch msb {
			case 0xF0:
				return kb.down(uint8(c), 0)
			case 0xE0:
				return kb.down(0, uint8(c))
			case 0xE2:
				return kb.downSys(uint8(c))
			default:
				if 0xE4 <= msb && msb <= 0xE7 {
					return kb.downCon(uint16(c & 0x03FF))
				}
				return ErrInvalidKeycode
			}
		}
	}
	c = keycode(uint16(c))
	if 0 == c {
		return ErrInvalidCodepoint
	}
	if d := deadkey(c); 0 != d {
		res = kb.mod
		if 0 != res {
			kb.mod = 0
			kb.dc.keyboardSendKeys(false)
		}
		kb.down(d.key(), d.mod())
		kb.up(d.key(), d.mod())
	}
	return kb.down(c.key(), c.mod()|res)
}
func ( kb * Keyboard ) Down ( c Keycode ) error { var res uint8 msb := c >> 8 if msb >= 0xC2 { if msb < 0xE0 { c = ( ( msb & 0x1F ) << 6 ) | Keycode ( c . key ( ) ) } else { switch msb { case 0xF0 : return kb . down ( uint8 ( c ) , 0 ) case 0xE0 : return kb . down ( 0 , uint8 ( c ) ) case 0xE2 : return kb . downSys ( uint8 ( c ) ) default : if 0xE4 <= msb && msb <= 0xE7 { return kb . downCon ( uint16 ( c & 0x03FF ) ) } return ErrInvalidKeycode } } } c = keycode ( uint16 ( c ) ) if 0 == c { return ErrInvalidCodepoint } if d := deadkey ( c ) ; 0 != d { res = kb . mod if 0 != res { kb . mod = 0 kb . dc . keyboardSendKeys ( false ) } kb . down ( d . key ( ) , d . mod ( ) ) kb . up ( d . key ( ) , d . mod ( ) ) } return kb . down ( c . key ( ) , c . mod ( ) | res ) }
Down transmits a press (key-down) event for the given Keycode.
Down transmits a press ( key - down ) event for the given Keycode .