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.

Filter by
Sorted by
Tagged with
0 votes
0 answers
24 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
60 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 ...
1 vote
1 answer
84 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++ ...
4 votes
2 answers
231 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 ...
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
41 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
60 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
80 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 ...
0 votes
0 answers
150 views

Debouncing events and stale closures in functional React

Context As part of our React application, in which we use functional components, we encountered a scenario where we needed to debounce parts of a DOM event listener for usability purposes. The actual ...
2 votes
1 answer
1k views

GLFW simple event handler

I wrote a simple concept of an event system in cpp. It is uses a namespace and a global state, but normally a global state with namespaces is bad practice. Is there a better way to do simple event ...
4 votes
1 answer
215 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. ...
3 votes
2 answers
2k 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, ...
1 vote
0 answers
52 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, ...
6 votes
1 answer
537 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 - ...
6 votes
3 answers
2k 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
137 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
1 answer
2k views

C++ Event System - Game Engine

Introduction I have just started learning templates and experimenting with function pointers. I wanted to create an event system that met a couple of goals: Event types are PODs, and do not inherit ...
1 vote
0 answers
22 views

Event system in react

What I Want? I want to make an event system in React that cuts back on unnecessary re-renders and stops props drilling. What I Did? The code I came up with is the following: ...
0 votes
1 answer
63 views

JS "Tabs" element

How can this be improved? I'm looking particularly at the twice repeated tabButtons.forEach(button => { ...
8 votes
2 answers
853 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
3 answers
196 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 ...
0 votes
1 answer
65 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 ...
3 votes
1 answer
3k views

C++ 14 event bus implementation

The code allows you to subscribe to events and publish events via an EventBus class. Events are identified by a source and subject. Events can have a single ...
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
40 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: ...
9 votes
2 answers
5k views

"Block a website" script with vanilla JavaScript

I use this script to block access to a one or more websites with vanilla JavaScript. I find that it helps me avoid some addictive news websites that make me depressed. (Credit to Marat Tanalin for ...
4 votes
2 answers
26k views

onChange vs onKeyPress for input in React

I have an input form, and when you press enter I want it to call a function. I was wondering what "the right" way of doing this is. Right now I have an input looking like this: ...
2 votes
0 answers
71 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 ...
4 votes
1 answer
447 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
2 answers
452 views

jQuery form.find radio class

In my application we have four inputs that are radio controls and the first radio control is checked by default. When the user selects another radio control and then saves the form I want to get the ...
2 votes
1 answer
875 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 ...
0 votes
1 answer
143 views

Range slider show/hides and reset (vanilla js)

I have a HTML5 range slider. i.e. ...
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 ...
37 votes
5 answers
3k views

When "How To Ask" is too subtle

This is the first JavaScript code I've ever written, alert("hello, world!"); aside. This site is closing quite a lot of questions because people won't read the ...
1 vote
1 answer
451 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 ...
3 votes
0 answers
264 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 ...
1 vote
1 answer
182 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
274 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
275 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
288 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 ...
7 votes
1 answer
4k views

Event system using callback functions in C++

I am learning C++ and have been trying to create an event system for use in a small game. This will be the mechanism by which game entities communicate. I would be eternally grateful if someone with ...
3 votes
1 answer
340 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
950 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 ...
1 vote
1 answer
159 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 ...
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
157 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 ...
0 votes
2 answers
163 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. ...
10 votes
1 answer
424 views

Resizable containers with VueJS

A month ago I reviewed the code in Resizable split DIVs Vue.js, suggesting that the OP use computed properties and bound styles to simplify the code (at least reducing the need to use ...
3 votes
2 answers
86 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 ...
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 ...

1
2 3 4 5
10