MCPcopy Create free account
hub / github.com/cogentcore/core / shiftSelect

Method shiftSelect

core/textfield.go:895–903  ·  view source on GitHub ↗

shiftSelect sets the selection start if the shift key is down but wasn't previously. If the shift key has been released, the selection info is cleared.

(e events.Event)

Source from the content-addressed store, hash-verified

893// shiftSelect sets the selection start if the shift key is down but wasn't previously.
894// If the shift key has been released, the selection info is cleared.
895func (tf *TextField) shiftSelect(e events.Event) {
896 hasShift := e.HasAnyModifier(key.Shift)
897 if hasShift && !tf.selectMode {
898 tf.selectModeToggle()
899 }
900 if !hasShift && tf.selectMode {
901 tf.selectReset()
902 }
903}
904
905// selectRegionUpdate updates current select region based on given cursor position
906// relative to SelectStart position

Callers 1

handleKeyEventsMethod · 0.95

Calls 3

selectModeToggleMethod · 0.95
selectResetMethod · 0.95
HasAnyModifierMethod · 0.65

Tested by

no test coverage detected