// OnTouchBegin is called when Red Button is Touched.
359473
func (c *ButtonRedTouchListener) OnTouchBegin(x, y float32) {
	if c.buttonReplaced {
		c.originalButtonColor()
	} else {
		c.replaceButtonColor()
	}
	c.simra.AddSprite(c.ball)
	tex := c.simra.NewImageTexture("ball.png",
		image.Rect(0, 0, c.ball.GetScale().W, c.ball.GetScale().H))
	c.ball.ReplaceTexture(tex)
}
1018504
func ButtonType(button input.ButtonType) MouseOption {
	return func(p *input.DispatchMouseEventParams) *input.DispatchMouseEventParams {
		return p.WithButton(button)
	}
}
1265106
func (t *Title) OnTouchEnd(x, y float32) {
	if t.isAnimating {
		t.text.StopAnimation()
		t.isAnimating = false
	} else {
		t.text.StartAnimation("animation test", true, func() {})
		t.isAnimating = true
	}
}
667595
func (c *Collection) Touch(key string, expiration uint32, opts *TouchOptions) (mutOut *MutationResult, errOut error) {
	if opts == nil {
		opts = &TouchOptions{}
	}

	span := c.startKvOpTrace(opts.ParentSpanContext, "Touch")
	defer span.Finish()

	ctx, cancel := c.context(opts.Context, opts.Timeout)
	if cancel != nil {
		defer cancel()
	}

	res, err := c.touch(ctx, span.Context(), key, expiration, *opts)
	if err != nil {
		return nil, err
	}

	return res, nil
}
276744
func (reactorFunc DynamoDBReactorFunc) OnDynamoEvent(ctx context.Context,
	dynamoEvent awsLambdaEvents.DynamoDBEvent) (interface{}, error) {
	return reactorFunc(ctx, dynamoEvent)
}
956121
func (tp *TouchPeer) RemoveTouchListener(listener TouchListener) {
	simlog.FuncIn()
	tp.touchListeners = remove(tp.touchListeners, listener)
	simlog.FuncOut()
}
821655
func (g *Gui) onKey(ev *termbox.Event) error {
	switch ev.Type {
	case termbox.EventKey:
		matched, err := g.execKeybindings(g.currentView, ev)
		if err != nil {
			return err
		}
		if matched {
			break
		}
		if g.currentView != nil && g.currentView.Editable && g.currentView.Editor != nil {
			g.currentView.Editor.Edit(g.currentView, Key(ev.Key), ev.Ch, Modifier(ev.Mod))
		}
	case termbox.EventMouse:
		mx, my := ev.MouseX, ev.MouseY
		v, err := g.ViewByPosition(mx, my)
		if err != nil {
			break
		}
		if err := v.SetCursor(mx-v.x0-1, my-v.y0-1); err != nil {
			return err
		}
		if _, err := g.execKeybindings(v, ev); err != nil {
			return err
		}
	}

	return nil
}
630501
func (t *Title) OnTouchEnd(x, y float32) {
	// scene end. go to next scene
	t.simra.SetScene(&sample{})
}
173167
func (a *Astilectron) On(eventName string, l Listener) {
	a.dispatcher.addListener(targetIDApp, eventName, l)
}
1053579
func (w *Window) JoystickPressed(js Joystick, button int) bool {
	return w.currJoy.getButton(js, button)
}
933003
func (sc *SpriteContainer) OnTouchEnd(x, y float32) {
	sc.emitTouchEvent(x, y, touchEnd)
}
986699
func (m *Meta) WasTouched(field string) bool {
	m.detectTouchedFlags()
	ptr, ok := m.fieldsMap()[field]
	if !ok {
		panic(fmt.Sprintf("no such meta field %s", field))
	}
	_, yes := m.touched[ptr]
	return yes
}
1023393
func (batch *MessageBatch) Touch() {
	atomic.StoreInt64(batch.lastFlush, time.Now().Unix())
}
198969
func (m *Meta) PopulateFromTouchedIn(t *Meta) {
	t.detectTouchedFlags()
	left := m.fieldsMap()
	right := t.fieldsMap()
	for k, l := range left {
		r := right[k]
		if _, yes := t.touched[r]; yes {
			// Do *l = *r.
			switch l.(type) {
			case *string:
				*(l.(*string)) = *(r.(*string))
			case *bool:
				*(l.(*bool)) = *(r.(*bool))
			case *[]string:
				*(l.(*[]string)) = append([]string(nil), *(r.(*[]string))...)
			default:
				panic("impossible")
			}
		}
	}
}
1167619
func ButtonMiddle(p *input.DispatchMouseEventParams) *input.DispatchMouseEventParams {
	return p.WithButton(input.ButtonMiddle)
}
1198084
func (light *Light) Toggle() error {
	if light.State.On {
		return light.Off()
	}
	return light.On()
}
829527
func (reactorFunc SNSReactorFunc) OnSNSEvent(ctx context.Context,
	snsEvent awsLambdaEvents.SNSEvent) (interface{}, error) {
	return reactorFunc(ctx, snsEvent)
}