Questions tagged [event-handling]
Event handling is a coding pattern related to acting on messages between a source and one or more subscribers. A point listener in the source provides a way in which subscribed code can consume messages raised from the source.
467 questions
4
votes
1
answer
98
views
Page scroll marker user script
I recently recalled having a "scroll mark" feature, that is, a line that would show up when hitting the space bar in the Opera browser? There used to be a Greasemonkey script for Firefox, ...
1
vote
1
answer
55
views
Listening to bootstrap 5 events in a vuejs application
Starting out with VueJS, making a small fun project. The project is a simple static portfolio website, with a navigation bar at the top and a bootstrap scrollspy, jumping to the different sections (I ...
4
votes
3
answers
197
views
Get the contents of a table cell for all selected rows
I have a table of user info. When you click the button, I want to get the email address from each selected row, output into a comma-separated string.
I got it to work with the following code, but I'm ...
3
votes
1
answer
101
views
Simple C++ event loop - static vs dynamic dispatch performance
I have two extremely simple toy implementations of an event loop, and would like to understand the performance differences between them.
First impl - events with a virtual 'handle' method - dynamic ...
0
votes
0
answers
32
views
Messaging correlation and syncing
We use masstransit and sagas. But I also wanted to correlate some messages without the need for a saga since the syntax for those are pretty verbose if all your need is to sync on a correlation id.
...
1
vote
1
answer
69
views
Event manager based on decorators
This module is a simple event manager that works with decorators. I would like feedback on:
Bugs
Any ideas to get rid of the classevent decorator, which ...
3
votes
1
answer
106
views
A Windows localhost key logger in C++ with WinAPI
Now I have this repository. It's a key logger logging all the keyboard events possible. Note that some programs do not "leak" the keyboard events outside of their GUI. For example, Notepad++ ...
11
votes
2
answers
2k
views
CAT: Cat Approved TUIs
Cat
Hello everyone! I am working on this TUI framework which aims to abstract the ncurses library. I was wondering how understandable it is, and what I can improve! Any feedback is welcome!!
My ...
1
vote
0
answers
50
views
A JavaFX program to find out the mouse refresh rate v3
(This post is the continuation of A JavaFX program to find out the mouse refresh rate v2.)
After taking @J_H's suggestions into account, I ended up here:
...
3
votes
1
answer
67
views
A JavaFX program to find out the mouse refresh rate v2
(See the continuation of this post in A JavaFX program to find out the mouse refresh rate v3.)
(This post is a continuation of A JavaFX program to find out the mouse refresh rate.)
After adopting the ...
2
votes
1
answer
86
views
A JavaFX program to find out the mouse refresh rate
(See the next version here.)
Intro
I have this tiny JavaFX program that shows a 800x600 pixel canvas. You are supposed to drag the mouse within the canvas. When you are done dragging, the program will ...
4
votes
1
answer
257
views
Improved Event System & InputManager Using C++
I am new to C++, so please take me easy. I want to make a low-level game engine only using C++, OpenGL and GLFW. This is a continuation of Event System using C++ ; I added the suggestions from there. ...
1
vote
0
answers
55
views
Event System in C++ [duplicate]
I am excited to share that I have developed an event system in C++. I have always been passionate about programming and have long aspired to create a low-level game engine solely using C++, OpenGL, ...
3
votes
2
answers
3k
views
Event System using C++
I am excited to share that I have developed an event system in C++. I have always been passionate about programming and have long aspired to create a low-level game engine solely using C++, OpenGL, ...
4
votes
2
answers
445
views
Detecting when a user stops typing
I wanted to detect when a user stops typing. I encountered this answer from SO (Not the selected answer, but the second one which seem to be better):
https://stackoverflow.com/a/5926782/17746636
But I ...
6
votes
1
answer
678
views
Event manager for games written in C++17
This is a single header event manager that I'm using in my game.
Disclaimer
I ripped everything from these lovely people:
https://austinmorlan.com/posts/entity_component_system/
C++ Event System - ...
7
votes
3
answers
3k
views
EventBus in C++
Edit
I do know the example key event doesn't carry any data (like keycode) but that isn't really the point of the review - the overall setup is :)
Original
After reading quite few suggestions on this ...
3
votes
3
answers
142
views
Follow up: A chat server using the select() API
This is a follow up to my last question:
Multiperson chat server using the select() API
Changes:
After much fine critique, I made the following changes to the code:
Removed redundant casts and ...
8
votes
2
answers
975
views
Event functionality in C
I am beginner to intermediate and wanted to write a little event code in c.
It's one header file with 108 line pure code and it does what I was thinking it should be like for me.
EventListener.h
...
0
votes
1
answer
67
views
Delayed, concurrent event stack in Java - follow-up
I have slightly refactored the Delayed, concurrent event stack in Java. Now it looks like this:
DelayedEventStack.java
...
0
votes
3
answers
202
views
Delayed, concurrent event stack in Java
(See the next iteration:
Delayed, concurrent event stack in Java - follow-up )
Motivation
I was confronted with a task of having "message events" for a GUI program. The use case is as ...
3
votes
1
answer
1k
views
Count how many times left mouse button is clicked
The code snippet works perfectly fine, but someone said, and I quote, "this is some of the weirdest code i've seen", so I'd just like any advice for it. It's supposed to count the amount of ...
1
vote
1
answer
44
views
Moveable Points - Update variable without Re-referencing variable? Event Subscriptions? (C#, Unity)
So I have this helper script that I use to move points around manually while debugging:
...
2
votes
0
answers
72
views
To-do list application
I use a lot of for loops and I think it slows the code down a lot but I have no idea how else this code could be written. Its for a to-do list app and each ...
0
votes
1
answer
71
views
JS "Tabs" element
How can this be improved?
I'm looking particularly at the twice repeated tabButtons.forEach(button => {
...
4
votes
1
answer
545
views
Setting all hidden fields based on id
I am working on a web page where there is a checkbox with a value and a hidden field. I want to ask your opinion on whether this logic is sound.
My logic
The checkbox has a value that matches the id ...
2
votes
1
answer
960
views
Animating GIF on hover in Javascript
I don't know JavaScript and it's safe to say this is my first code ever written in JS.
I just needed to animate my GIFs when user hovers over them only.
Googling separate concepts such as "string ...
1
vote
1
answer
60
views
Event handler for client webrtc video chat
This is my event handler for a videochat client that takes all the events that the server throws at us and routes them to different functions. All of the functions are imported and both settings and ...
0
votes
1
answer
164
views
Range slider show/hides and reset (vanilla js)
I have a HTML5 range slider. i.e. ...
1
vote
1
answer
493
views
Basic Event manager implementation
I have written a very simple algorithm vizualizer where all input is coming from the mouse and I needed an event manager for that. Since I never wrote one before, I wrote a 30 min implementation to ...
1
vote
1
answer
195
views
A C WinAPI program for showing the color of the screen pixel pointed to by mouse cursor with clipboard support - follow up
(See the previous question.)
Now I have incorporated some suggestions by Barmak Shemirani.
See what I have:
...
4
votes
2
answers
287
views
A C WinAPI program for showing the color of the screen pixel pointed to by mouse cursor with clipboard support
(See the follow-up question.)
I have this program that shows a small window and that window shows a rectangle whose color is the same as the color of the pixel under the mouse cursor. Note that it ...
0
votes
1
answer
282
views
Updating active cards dynamically added by API
I am making a website where you can search through all the countries in the world. Once you have found a country you want more detail about you should be able to click and view a detailed page with ...
2
votes
2
answers
308
views
Event Dispatcher for GLFW/Glad
I've tried to write an event dispatcher for a GLFW/Glad library. However I am not very used to writing efficient code (spent the majority of my life writing in C# and performance was never really the ...
3
votes
1
answer
376
views
Javascript array from IP address
I want to make this code better. It works now but I think it can be better. I have a working sample on jsfiddle.
When the page loads I have the End IP Address disable until the data is entered. Then I ...
3
votes
2
answers
1k
views
Event Dispatching System
Below you can see my implementation of a simple event dispatcher. I would like to get some feedback or improvement tips regarding the design and maybe an idea how to get rid of the static_cast. Thank ...
2
votes
1
answer
1k
views
Generic Event class
C++ Event class
From the desire of having a callback function which includes a void* userdata argument, I've made this generic event class.
It is tested and working, but some desired features are ...
1
vote
2
answers
176
views
Javascript - On mouseup check if any of the parents has/includes specific id
On my page I have a mouseup eventlistener on document. I want to be able catch if the clicked elements has a specific ...
1
vote
1
answer
164
views
list of games to open radar match in iframe on for drop-down controls
In general my page is slow and has several points in the code that I believe can be improved, even in relation to the structure used. Anyway, the biggest problem is:
The page I'm creating is very ...
3
votes
2
answers
103
views
Javascript (ES11) Event System implementation
So I decided to implement a basic event system in JavaScript.
My goal was to support the following functions:
on - allows the user to register a handler on the ...
3
votes
0
answers
281
views
A Compile-time templated event system and dispatch manager
Problem
I would like to make an efficient, extensible, and potentially asynchronous parallelizable event system using modern features in C++20.
My solution
I've constructed a templated event struct by ...
0
votes
2
answers
168
views
is this a good way of using events?
So I'm currently trying to learn more about events using C# and the example that I just write seems a bit.. It seems a bit too much? I feel like you could accomplish the same thing with way less code. ...
3
votes
2
answers
90
views
Limit second <select> options based on the first <select>
I want to see if there's a better way to write this code, solely in Javascript.
There are two kinds of sets, the first set (C7, T7, C11, T11) have four options in the first select, and then up to two ...
2
votes
1
answer
320
views
To-do app front-end in Vue 3
I have put together a To-do Application with the Slim framework on the back-end (API) and a Vue 3 front-end. I added a demo on my YouTube channel.
In the main App.vue file I have:
...
4
votes
2
answers
983
views
Vue.js checkout stepper
I have made this small checkout stepper with Vue (v 2.x.x):
...
1
vote
1
answer
321
views
dispatch event listener problem after click
My code is working fine...
but I want to remove below those(1) lines of code from my example code(2) (JS Code). If I remove those code then a tag is not working. (a tag do not open link or href is not ...
2
votes
1
answer
339
views
JavaScript copy-to-clipboard class
I am have made a small copy-to-clipboard script.
I have made a method called copyToClipboard that does the following:
create an input box;
read the content of an ...
4
votes
1
answer
95
views
Javascript Pub/Sub
Here is a short pice of code that suppose to work as Pub/Sub or EventDisptacher of some sort.
I only do code in JS a few times a year, so hence I'm asking for your time. Right now I'm working on ...
6
votes
1
answer
8k
views
C++ event loop and thread signaling
Use case
This is an event loop and signaling system I created for a piece of software which will have multiple asynchronous server/clients/event-emitters/ui, some of those components will have their ...
3
votes
2
answers
10k
views
C++: Event system for game engine
Since writing your own C++ game engine seems to be really popular these days (seriously just look at the amount of people presenting their WIPs on YouTube) I figured I'd try it myself.
My mental model ...