Skip to main content

Questions tagged [eventhandler]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
2 votes
0 answers
58 views

How to apply Esc key as double typing in EventHandler?

I wrote a code to delete the text in InputField with the Esc key. ...
Milk's user avatar
  • 1,718
1 vote
1 answer
66 views

Selecting regions from the screen to capture dynamically

I know that by using CurrentScreenImage with some coordinates that I can capture regions of my screen. I would like to be able to capture a rectangular region of my ...
Diffycue's user avatar
  • 1,844
1 vote
0 answers
36 views

Help fixing dynamic graphics with multiple features

I'm trying to create a graph drawing widget, here are its basics that just allow you to create and drag vertices: ...
swish's user avatar
  • 7,921
1 vote
1 answer
34 views

How to put an on-click event into a new notebook opened with NotebookPut?

This prints "This is the question", and then when you click on it it prints "This is the answer": ...
tell's user avatar
  • 320
3 votes
2 answers
92 views

Create vanishing button to transition between images

I have multiple "slides" that I would like to transition between, by clicking a specific area on each slide. eg: ...
martin's user avatar
  • 8,678
3 votes
0 answers
38 views

How to Get Mathematica to Recognize a Three-Finger Trackpad Click?

The following code allows me to change the size of a disk back and forth with a one-finger trackpad click, and change the color of a disk back and forth with a two-finger trackpad click. ...
B flat's user avatar
  • 5,565
2 votes
0 answers
68 views

How to get a Fountain Pen effect when Drawing Curves?

I am attempting to draw a curve where the width of the curve reduces with the speed at which I drag the mouse (a fountain pen effect). The gif below demonstrates the desired functionality. The code ...
B flat's user avatar
  • 5,565
2 votes
2 answers
105 views

Make curve disappear gradually after Mouse Up

I am trying to emulate a feature on GoodNotes that allows me to draw a glowing curve on a graphic and the moment I let go of the mouse, the curve gradually disappears. See gif below. The gif is a ...
B flat's user avatar
  • 5,565
7 votes
1 answer
87 views

How do I include additional kinds of boxes that are Tab-selectable

Observe that "PlaceHolder" and InputFieldBox are known by the FE to respond to pressing the Tab key: ...
QuantumDot's user avatar
  • 19.7k
9 votes
1 answer
413 views

Using graphics primitives as buttons

I am trying to use graphics primitives as buttons, but can't do it unless I rasterise first: ...
martin's user avatar
  • 8,678
10 votes
3 answers
222 views

Context menu to graphics component

How do I add individual context menus (shown upon secondary mouse click) to various components of a graphics object without needing to go into edit mode? Consider the following example: ...
QuantumDot's user avatar
  • 19.7k
1 vote
2 answers
322 views

How to reset an event counter to zero after every nth evaluation while using Experimental`ValueFunction to observe for value changes in counter

Synopsis Below serves as a skeleton for a function that will track number of occurrences of a particular notebook event. The nth event will trigger a function call. After which the counter symbol must ...
Jules Manson's user avatar
  • 2,467
1 vote
0 answers
46 views

"StopIntegration" inside the "EventAction" is not working in the given instance

...
Souraj Ghosh's user avatar
3 votes
2 answers
100 views

How to solve the problem of EventHandler losing focus?

...
xingzheshengcun's user avatar
2 votes
0 answers
36 views

Need to determine turn in Connect Four based on mouse clicks (Mathematica)

I am making a connect four game and I need to figure out which graphic to use (red or black) by how many times the mouse has been clicked. So I need a counter for mouse clicks. That way I can make an ...
Maggie's user avatar
  • 21
4 votes
1 answer
634 views

Switch bool from False to True on key press?

I would like to let a boolean variable switch when I press a key on the keyboard. For example, I write ...
Kagaratsch's user avatar
4 votes
1 answer
125 views

Does MousePosition["Graphics"] give coordinates in outermost Graphics?

It seems that this issue has been raised a few times, but what exactly does MousePosition["Graphics"] answer? This code ...
Pavel Perikov's user avatar
4 votes
0 answers
114 views

How to control global key event handling for all front end sessions?

This website collects many methods for implementing user defined keyboard shortcuts through KeyEvent items in KeyEventTranslations.tr, see 16697, 16165, 23285, 2572, etc. Some of these were collected ...
Vladimir's user avatar
  • 1,503
4 votes
3 answers
211 views

EventHandler not handling my events

I seem to be able to use EventHandler to handle mouse events, but not keyboard events. Here is a working example with MouseClicked -- it makes the picture smaller every time the right mouse button is ...
bill s's user avatar
  • 69.1k
0 votes
0 answers
37 views

What is the name of the Page Down key when using EventHandler? [duplicate]

I want to trap the PageDown event in an EventHandler. The code I've written is working fine for, say, "RightArrowKeyDown". But for the life of me I can't find the label for the Page Down key. I've ...
RobertNathaniel's user avatar
2 votes
0 answers
47 views

How to use GestureHandler?

Gesture handlers would be really cool to have. There is a symbol called GestureHandler. It's eight years old (from v9) but intriguing to me, as I could never ever get it to work. Does anyone know ...
M.R.'s user avatar
  • 31.5k
6 votes
0 answers
109 views

How to create a conditional EventHandler

Summary Can we make something like the following work as an action for EventHandler? ...
Lukas Lang's user avatar
  • 34.1k
0 votes
0 answers
37 views

What is the current notebook save event for the `EventHandler`?

Suppose I have an action like follows: ...
user13892's user avatar
  • 9,443
3 votes
1 answer
128 views

Nested front-end-only EventHandler

Bug introduced in 11.3 or earlier, and persisting through 12.0 CASE:4372001 confirmed I am running into an issue trying to improve the performance of my user interface by moving as much of the ...
Lukas Lang's user avatar
  • 34.1k
6 votes
1 answer
127 views

How to implement LocatorAutoCreate functionality using EventHandler[]?

The documentation for LocatorPane says that LocatorPane is a special case of EventHandler, and gives the following code: ...
user63017's user avatar
  • 117
1 vote
0 answers
42 views

Why does dragging a point with a Tooltip interfere with MousePosition["Graphics"]?

Consider the following toy example of EventHandler used to implement dragging a point around in a Graphics: ...
glS's user avatar
  • 7,623
3 votes
1 answer
173 views

EventHandler and Dynamic

I just found a behaviour of an EventHandler that I cannot explain. Here is a highly simplified version. I will present two simple ...
Fred Simons's user avatar
  • 10.2k
1 vote
1 answer
127 views

Multiple calls to SetOptions with NotebookEventActions: How to retain earlier custom event handlers?

I have a module defining handlers of KeyDown events that I reuse in various notebooks. In some cases I need to define separate handlers for additional keys. Unfortunately, later calls to ...
volk's user avatar
  • 65
3 votes
0 answers
65 views

How can I disable built in selection action for mouse click events? [duplicate]

I am trying to improve a demonstration that I previously submitted to the Wolfram Demonstration site. That demonstration enables a user to select a position on an Earth globe and see the latitude and ...
Spencer Rugaber's user avatar
0 votes
1 answer
69 views

Help with actions in EventHandler

I am trying to write a program where the user types on the keyboard in a specified location, and Mathematica outputs what you are currently typing, plus a prediction that is updated in real time of ...
Bongo Funk's user avatar
0 votes
0 answers
46 views

Is there a "LostFocus" event for controls? [duplicate]

In .Net controls have a LostFocus event that fires when the control is no longer the active object; tabbing to next control or clicking somewhere else on the ...
Edmund's user avatar
  • 42.3k
4 votes
1 answer
186 views

Modify Dynamic value within EventHandler

I'm trying to build a tic tac toe program using a 3x3 board list running inside of a DynamicModule with a separate window displaying the current value and accepting ...
Chris's user avatar
  • 55
3 votes
0 answers
50 views

Is it possible to prevent LocatorPane from modifying locator positions unless Alt ket is down?

I am using the LocatorAutoCreate option which allows the user to hold Alt while clicking in order to create/remove locators. However, I need to be able to prevent ...
user52941's user avatar
2 votes
1 answer
76 views

Plotlabel in Monitor

I am using three For loops and would like to show a series of plots in the same window. I am using Monitor and I want to see the parameters in each plot. Here is my code: ...
Kassik's user avatar
  • 71
7 votes
1 answer
1k views

How can I get 'KeyDown' without writing 26 commands?

EventHandler and {"KeyDown","x"} work for registering a specific letter. Is there a direct way to return whichever letter keys ...
Taylor B.'s user avatar
1 vote
1 answer
36 views

Modifying this GoL implementation to make it sensible to clicks on the corner of the array

I'm interested in modifying this interactive implementation of the Game of Life http://demonstrations.wolfram.com/RealTimeSimulationOfTheGameOfLife/ to make it sensible to click events on the ...
andandandand's user avatar
  • 2,393
4 votes
3 answers
210 views

Plot with different line style when clicked

I have a plots with many lines and would like to be able to highlight lines when clicked (or on mouseover). When the data plotted is small this works well ...
Gustavo Delfino's user avatar
14 votes
1 answer
216 views

Visually permute rows of a matrix via mouse dragging

I'm looking for a way to permute the rows of a matrix visually via mouse dragging, for example by clicking and dragging on a row in the MatrixPlot corresponding to the matrix. What would be the best ...
glS's user avatar
  • 7,623
1 vote
1 answer
57 views

Why are changes to dynamic value not delivered to all GUI elements as they happen?

The widget below is just a toy that I put together so that I could ask this question. ...
kjo's user avatar
  • 11.7k
13 votes
1 answer
571 views

How to create Right-Click ActionMenu at mouse position?

I have a Grid and need to enable some actions on individual values. For this I want to use an ActionMenu that shows on right-...
Edmund's user avatar
  • 42.3k
5 votes
1 answer
456 views

Response of Dynamic is slow

I wrote the following code to make an interactive GUI for Mathematica's Neural Network example of Digit Classification Here is the Code ...
Dip773's user avatar
  • 77
4 votes
1 answer
172 views

How to use an event handler inside of a Dialog Notebook

I am designing a tank game in Mathematica for my class and currently I have a tank that can drive along a curve and shoot a point at a set angle, but I want to get all of this into some sort of pup up ...
steven gaiko's user avatar
4 votes
2 answers
206 views

How can I draw a variable number of dynamic, interactive objects, preserving their internal states?

Consider the following toy example: I have a "dynamical, interactive" graphics primitive like the following: ...
glS's user avatar
  • 7,623
1 vote
0 answers
151 views

Custom FrontEndToken calls

So I've been playing with FrontEndTokens recently and discovered that there are some of them that don't seem to have a standard-usage way of being called. For ...
b3m2a1's user avatar
  • 46.9k
1 vote
0 answers
164 views

Making graphic objects disappear interactively

I am trying to create a program where dots on a plane disappear when an object passes over them. I am using EventHandler to code the arrow keys for control of the ...
Savannah S's user avatar
1 vote
1 answer
142 views

Very slow updates using LocatorPane [closed]

Making an app for conic sections I need that when point ptA is moved, point ptB shifts the same distance and in the same direction of ptA (i.e. a translation). This is the (simplified) code. ...
wmora2's user avatar
  • 599
26 votes
1 answer
5k views

How to draw an interactive, mouse clickable, 3D Bloch sphere?

A 3D Bloch (Poincaré) sphere is nicely shown in this wolfram demonstration. However, in that example, it is not possible to mouse select a point on the sphere and directly get the corresponding qubit ...
glS's user avatar
  • 7,623
0 votes
0 answers
71 views

How to implement multiple EventHandlers? [duplicate]

n00b Mathematica user here. I wrote this code: ...
Bob Jones's user avatar
  • 131
0 votes
1 answer
170 views

How to trigger an event whenever the variable controlled by an InputField is changed?

Consider an an InputField object of the form DynamicModule[{x = 0}, {InputField[Dynamic@x],Dynamic@stuffDependingOnx} ] ...
glS's user avatar
  • 7,623
1 vote
2 answers
170 views

How does EventHandler work inside a Graphic

I've created an application with the User Interface being a Graphic with lines, polygons etc. The functionality I need is: to be able to place the objects anywhere in {x,y} coords of the Graphic. to ...
Robert's user avatar
  • 435