Item_selected does not send a signal and I can't figure out why

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By jonobugs

I created an list with an ItemList container and I populate it with data that a user can type in.

I want to be able to copy the item and move it to a list so I decided to just copy the item when it’s selected by a left mouse click and then paste it when the user clicks an empty area in another list.

I originally wanted to drag and drop but I couldn’t find any tutorials on how to do that with text.

Anyway, I’m running into a problem with the signal not being activated. My solution works if I use item_rmb_selected but I would rather use a regular left click since I want to port this to an android.

I tried deleted the connection, try it again, tried it with a different container, but none seem to work in that I just use a print statement just see if the signal gets there. No errors, but it doesn’t work. Like I said, it works when I click on an empty spot and it work if I use the right mouse button.

In a different area, I was able to use this item_select function to bring focus to an input area so I’m perplexed as I can’t get it to work. The only difference is on the one that works, I have a menu system set up whereas in the second one the list is generated afterwards.

Any help would be greatly appreciated!

:bust_in_silhouette: Reply From: jonobugs

I finally figured out why this was happening.

I was using an itemList and one of the options “Select Mode” in which you could choose “single” or “multi”.

Since I wanted to be able to select several items to delete at once if needed, I chose “multi”. It did not work for me, in that I was only able to delete one line at a time anyway, but didn’t change that selection.

For whatever reason this caused the signal “item_selected” not to trigger. So, by going back to “single” on “Select Mode”, the signal started to work again.