@@ -329,10 +329,13 @@ OldPropertiesWindow::OldPropertiesWindow(wxWindow* win_parent, const Map* map, c
329329
330330 wxSizer* possizer = newd wxBoxSizer (wxHORIZONTAL);
331331 x_field = newd wxSpinCtrl (this , wxID_ANY, i2ws (teleport->getX ()), wxDefaultPosition, wxSize (-1 , 20 ), wxSP_ARROW_KEYS, 0 , map->getWidth (), teleport->getX ());
332+ x_field->Bind (wxEVT_CHAR, &OldPropertiesWindow::OnChar, this );
332333 possizer->Add (x_field, wxSizerFlags (3 ).Expand ());
333334 y_field = newd wxSpinCtrl (this , wxID_ANY, i2ws (teleport->getY ()), wxDefaultPosition, wxSize (-1 , 20 ), wxSP_ARROW_KEYS, 0 , map->getHeight (), teleport->getY ());
335+ y_field->Bind (wxEVT_CHAR, &OldPropertiesWindow::OnChar, this );
334336 possizer->Add (y_field, wxSizerFlags (3 ).Expand ());
335337 z_field = newd wxSpinCtrl (this , wxID_ANY, i2ws (teleport->getZ ()), wxDefaultPosition, wxSize (-1 , 20 ), wxSP_ARROW_KEYS, 0 , MAP_MAX_LAYER, teleport->getZ ());
338+ z_field->Bind (wxEVT_CHAR, &OldPropertiesWindow::OnChar, this );
336339 possizer->Add (z_field, wxSizerFlags (2 ).Expand ());
337340
338341 subsizer->Add (possizer, wxSizerFlags (1 ).Expand ());
@@ -593,6 +596,24 @@ void OldPropertiesWindow::OnFocusChange(wxFocusEvent& event)
593596 text->SetSelection (-1 , -1 );
594597}
595598
599+ void OldPropertiesWindow::OnChar (wxKeyEvent& evt)
600+ {
601+ if (evt.GetKeyCode () == WXK_CONTROL_V) {
602+ Position position;
603+ const Editor* const editor = g_gui.GetCurrentEditor ();
604+ if (posFromClipboard (position, editor->getMapWidth (), editor->getMapHeight ())) {
605+ x_field->SetValue (position.x );
606+ y_field->SetValue (position.y );
607+ z_field->SetValue (position.z );
608+ return ;
609+
610+ }
611+
612+ }
613+
614+ evt.Skip ();
615+ }
616+
596617void OldPropertiesWindow::OnClickOK (wxCommandEvent& WXUNUSED (event))
597618{
598619 if (edit_item) {
0 commit comments