Stack Exchange Network

Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [eventhandler]

The tag has no usage guidance.

5
votes
1answer
51 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: ...
0
votes
0answers
26 views

Using EventHandler in Slider [duplicate]

In general, I want to be able to load a new data using my function getECGsignal, according to the new slider value. I tried the following code, but it is not ...
1
vote
0answers
26 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: ...
3
votes
1answer
76 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 ...
8
votes
3answers
2k views

Hovering mouse cursor over a plot to display a “corresponding” point in another plot

I'm trying to reproduce a variant of this view, where hovering the mouse over a point highlights its "corresponding" point on all plots: In my case, the additional complexion is that the x-axes are ...
1
vote
1answer
64 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 ...
0
votes
0answers
49 views

Mathematics behind 3D point dragging

In several answers to questions related to dragging a point in 3D (for example: How can I select one out of several Graphics3D objects and change its coordinates in Mathematica?, or How can locators ...
3
votes
0answers
29 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 ...
0
votes
1answer
44 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 ...
7
votes
1answer
326 views

What is “MouseDragged”?

Bug introduced in V10.1 or earlier and persisting through V11.3 Print is triggered just by pressing the mouse button. ...
6
votes
0answers
95 views

Automated Phone Attendant with Mathematica [closed]

I'm considering using an old notebook with a built-in modem as an automated attendant. Basically, it would have the following functionalities: static menu pre-recorded messages caller interaction via ...
10
votes
1answer
249 views

Detect when InputField gets keyboard focus

How might I detect when an InputField comes into focus? For example ideally something like this would work. ...
0
votes
0answers
34 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 ...
7
votes
1answer
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 ...
4
votes
1answer
107 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 ...
3
votes
0answers
39 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 ...
2
votes
1answer
54 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: ...
9
votes
2answers
383 views

Throttle the response to keystrokes in an EventHandler expression

What might be the most elegant way to throttle the a,s functions triggered by an EventHandler...
1
vote
1answer
31 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 ...
3
votes
1answer
385 views

How to Use Mouse Events & EventHandler in Demonstrations

One of the primary criteria for an acceptable Demonstration is, of course, that multiple copies of the Manipulate Output Cells [MOCs] have to have independent controls and datasets: the operation of ...
11
votes
1answer
147 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 ...
3
votes
2answers
110 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 ...
1
vote
1answer
41 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. ...
5
votes
1answer
253 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 ...
12
votes
1answer
320 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-...
4
votes
1answer
114 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 ...
3
votes
2answers
139 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: ...
1
vote
2answers
119 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. ...
18
votes
1answer
2k 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 ...
1
vote
0answers
122 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 ...
1
vote
0answers
77 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 ...
5
votes
1answer
116 views

Triggering events based on choices made inside of system dialogs (e.g. window close)

I'm trying to arrange for Mathematica to perform a certain action every time a notebook is saved or closed (with or without saving). The obvious way to do this would be through event handling. So, ...
25
votes
1answer
737 views

How to improve these WASD + mouse look 3D controls?

Insipred by this question and the corresponding answer I've written a code for full-screen exploration of 3D scenes using standard WASD and mouse look controls. Here it is. ...
0
votes
0answers
65 views
0
votes
1answer
89 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} ] ...
1
vote
2answers
126 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 ...
6
votes
2answers
130 views

Abort an EventHandler?

How do I stop an EventHandler? I'm trying to allow the user unlimited inputs on the arrow keys UNTIL certain conditions are met, and then stop the ...
27
votes
4answers
2k views

Detecting KeyUp events

Is there a way to detect when a key is released, similar to EventHandler[InputField[], {"KeyDown", "k"} :> Print["k pressed"]] It seems such detection isn't ...
160
votes
1answer
28k views

Mathematica Minecraft

Some time ago I asked myself: with all these great graphics and interactive capabilities of Mathematica, what kinds of 3D games can be implemented in it? And the answer which came to mind is ...
3
votes
1answer
89 views

How to mimic CheckboxBar's Method->“Active” option in a Manipulate's checkbox control?

CheckboxBar has a Method -> "Active" option that allows you to click the label to change the state of a checkbox. I would ...
0
votes
1answer
165 views

How can I manually pick the data out of the image of a plot?

edit: The automatic way listed here doesn't work for an application like mine in which there are several curves on the same plot that all have the same markers, but you only want one curve (it will ...
8
votes
1answer
151 views

Docked cell showing keystrokes and mouse buttons actions

When I send bug reports to WRI, sometimes I attach a screen video record, like on the following example (that I just sent as an improvement suggestion). As you can see, I use OSD Hotkey, to make sure ...
3
votes
2answers
80 views

How to get highlighted text from event

I want to do the following: Given a text in a Mathematica dynamic module "at runtime". If some text is selected with the cursor/mouse, after the mouse button release, get the selected text. Thank ...
5
votes
1answer
75 views

Dynamically highlighting elements sharing common properties

I want to make a table of elements such that when the cursor is over a target element, all other elements of the table sharing some specified common property with the target are highlighted (let's say ...
1
vote
0answers
76 views

How can I perfect this game for Wolfram Demonstration publication? [closed]

When the messages change the window inactivates, and when I try to host an interactive CDF on my site it turns red and says something about numbers having to be scaled or offset. Any help? I'm ...
3
votes
0answers
45 views

EventHandler click event in Graphics[ ] object does not work properly after using Deploy [duplicate]

There is a problem clicking layered Graphics objects after using Deploy. For example, the code below works as intended with the Disk 'on top of' the Line. Click either object anywhere and EventHandler ...
1
vote
1answer
322 views

How to combine manipulate and eventhandler

I combine manipulate and eventhandler, now I can change the controller when working on eventhandler, but how to change the value in eventhandler when I control the manipulate controller? ...
1
vote
1answer
70 views

Using Loop to create mutiple EventHandlers

I have a problem, that is I want to use loop to create multiple EventHandlers, but my code shows nothing. What can I do? ...