Dhtmlx message copy paste content

I am not sure if this is the right place to start this thread, if it isn’t, please excuse me for that.

I am using the dhtmlx message popups, and I am striving to make the content of the pop up “copy-pastable” using the ctrl+C shortcut (although the right click copy works).
image
This is useful in my case since my software is often displaying content that needs to be used later.

I haven’t been able to find anything about that on the web and on your forums. Is there a way to enable the copy paste events?

Thanks for your time

The problem is confirmed. Unfortunatley in the current version of the dhtmlxMessage it is not available to use the keyboard shortcuts in th dhtmlxMessage. We’ve created a small fix enabling such feature. Please, open the ticket at the dhtmxSupport system, or (if you a using a STD version) please, clarify what package you are using, so I can provide you a fix here.

Hi sematik,

We are using the 5.1 version of DHTMLX.

Please, try to use the sources from the following package:
https://files.dhtmlx.com/30d/241ff94e1ad3bf8e86b4bf4da00cfe01/suite.zip
You need to add:

dhtmlx.message.keyboard = false

and will be able to use the keyboard shortcuts in the dhtmlxMessage.

Hi Sematik,
I might have been unclear in my previous message. We are using the 5.1 pro version of your library. The package you gave me does not match any of the files we have so I was not able to merge the two of them. I am wonder if you can give me the files from the dhtmlxMessage folder (if the problem is from one of those files).

I have tried, without success, the dhtml.message.keyboard = false without success (probably because i didn’t used the package you provided). I do have questions about this option. Where can I find a documentation about this parameters (and other from the dhtmlx.message/alert/… items)? Why are you setting the parameter to false when I do need the keyboard short cut enabled?

Thanks for your time again.

For the moment, I have found a workaround for my problem, but I would like to have a nicer and cleaner solution. What I did was modifying the dhtmlxmessage.js function named modal_key(e) with the following code:
image

As you can see, this code is far from being robust and clean, and I had to modify your library in order to do what I wanted. I would really like a clean workaround from your side.

the script from the attachment was the compiled package of the dhtmlxSuite 5.1 with the included fix for the dhtmlxMessage.
As for the sources of the fix here it is:

  • old
	function modal_key(e){
		if (_dhx_msg_cfg){
			e = e||event;
			var code = e.which||event.keyCode;
			if (dhtmlx.message.keyboard){
				if (code == 13 || code == 32)
					callback(_dhx_msg_cfg, true);
				if (code == 27)
					callback(_dhx_msg_cfg, false);
			}
			if (e.preventDefault)
				e.preventDefault();
			return !(e.cancelBubble = true);
		}
	}
  • fixed
	function modal_key(e){
		if (_dhx_msg_cfg){
			e = e||event;
			var code = e.which||event.keyCode;
			if (dhtmlx.message.keyboard){
				if (code == 13 || code == 32)
					callback(_dhx_msg_cfg, true);
				if (code == 27)
					callback(_dhx_msg_cfg, false);

				if (e.preventDefault)
					e.preventDefault();
				return !(e.cancelBubble = true);
			}
		}
	}

implementing it you may call

dhtmlx.message.keyboard = false

before the dhtmlxMessage initialization to allow you the keyboard shortcuts usage in the dhtmlxMessage.