Thread Rating:
  • 2 Vote(s) - 5 Average
  • 1
  • 2
  • 3
  • 4
  • 5
[New G2O][Client-Side] Clipboard
#1
*Introduction:

Info: You can support development of this code. Report me every bug below. I'll try to fix it.
NOTE! If you want to report a bug, make sure, that this isn't your fault!

I've recently written simple client-side squirrel module which allows you to manage windows
text clipboard. It's simple to use, it could give some new feature to chat, like ctrl+v shortcut.

*Video presentation:



Repository

Download

*List of functions:



bool setClipboard(string text) //returns true if text was succesfully putted into clipboard



*List of Events:



onPaste(string text) //event called when player press or hold ctrl+v keys



*Usage Example:



Squirrel Script
  1. addEventHandler("onPaste",function(text)
  2. {
  3. if (chatInputIsOpen()) // this if checks if chat input from G2O is opened. It's required, because event is called everytime when player press ctrl+v keys
  4. {
  5. chatInputSetText(chatInputGetText().slice(0,-1)+text) // getting text from chatInput, slicing last character (v), and concatenate it with text from clipboard
  6. }
  7. })





*Installation:



Client:

-Download module
-Put the module into this directory: Game/Multiplayer/Modules (if you don't have this folder, create it)



Server:

-Put the module into main folder
-Add this line into config.xml

PHP
  1. <module src="clipboard.dll" type="client" />


#2
Module has been updated!

List of changes:
-Changed hook from oCGame::Render to oCGame::HandleEvent
-From now on when you hold ctrl+v keys, function will be called more than once
#3
Module has been updated!

-From now on, you don't have to use timer, to delay callback call, because first are called original functions, then hook function.

@Edit:
-Video Presentation has been changed.
#4
Module has been updated!

List of changes:
-Changed callback (function onPaste) to event onPaste.

I could integrate event onPaste with chat input from G2O, but i don't want to do this, because not everyone always want to paste something to chat input.

That was propably one of the last module update. When i find some time, maybe i will push code to repository and give a free access to it.
#5
Module and thread has been updated!

Module:
-Minor changes in solution and code

Thread:
-Created and added git repository reference
-Removed md5 checksum
#6
Thread and repository has been slightly updated. I've added and modified .gitignore file, to allow binary (.dll) file to be uploaded when i make push to repository. This simplified the way to download binary file for me, because i don't have to re-upload a file into cloud (and for you, because you can now download the file directly).
#7
Module has been updated!

After changing resolution/world in game, event onPaste wasn't triggered, because hook oCGame::HandleEvent is reloaded by G2O in this two cases. Now (propably) everything is working perfectly (thanks for help CalystoCanem).
#8
In newer version of the G2O, you can paste the text into textInput by default.
Also, you have the same functionality, like in the module, so currently if i'm correct, the module it self is no longer needed.

Still, i'll leave all the links and this topic, maybe someone finds it useful in some way.


Possibly Related Threads…
Thread Author Replies Views Last Post
  [G2O] SpeedBlock Marbar 14 1,028 25.06.2020, 11:14
Last Post: Marbar
  [New G2O][Client-Side] LocalStorage Patrix 0 419 08.05.2020, 15:38
Last Post: Patrix
  [New G2O] Module example Patrix 4 3,875 17.05.2019, 00:30
Last Post: Patrix
  [New G2O][Client-Side] Music Module Nubzior 3 2,742 24.05.2018, 07:07
Last Post: Nubzior
  G2O - Client Side Bots(0.0.4) KimiorV 16 8,354 16.01.2017, 09:47
Last Post: KimiorV
  [DEV] G2O Bot module Sative 64 29,093 25.11.2016, 19:13
Last Post: HammelGammel
  G2O Client side bots KimiorV 4 2,606 09.06.2016, 19:11
Last Post: KimiorV

Forum Jump:


Users browsing this thread: 1 Guest(s)