Skip to content

Allow seamless editing of call input field - #516

Merged
zcsahok merged 17 commits into
Tlf:masterfrom
zcsahok:callinput_editing
Jul 30, 2026
Merged

Allow seamless editing of call input field#516
zcsahok merged 17 commits into
Tlf:masterfrom
zcsahok:callinput_editing

Conversation

@zcsahok

@zcsahok zcsahok commented Jul 17, 2026

Copy link
Copy Markdown
Member

Rethinking #495, focusing here on call input field only. Later on getexchnage can be changed the same way.
The goal is to achieve seamless editing of the callsign input field using the usual editing keys, while keeping the other special keys operational. Taking the approach of integrating editing into callinput() as mentioned as an option in #495.

First dropping the unused the 'int insert_char(int)' function. At the end the whole calledit.c file will be dropped.

@zcsahok

zcsahok commented Jul 17, 2026

Copy link
Copy Markdown
Member Author

Adding two helper functions

  • insert_char inserts a character into a string at a given position. The part of the string right from position (cursor) is shifted right. It returns the new cursor position. If the string would overflow the available size, then no action is taken.
  • delete_char removes the character at the given position. The part of the string right from the position is shifted left (like for the Delete key).

@zcsahok

zcsahok commented Jul 17, 2026

Copy link
Copy Markdown
Member Author

Now incorporating the editing functions into the switch statement of callinput. We have to track the cursor position (pos) and sync it if changed by an external action like grabbing, (re)storing, or cleaning.

Ctrl-A from editing clashes with the one from call input. One has to use Home key to navigate to the start of the input field.

The different color scheme used when editing is now gone. Should be no issue.

Apart from the generic working at least these special cases have to be checked

  • autosend
  • block_part (see searchlog.c)
  • callsign grabbing in digi mode

@zcsahok

zcsahok commented Jul 19, 2026

Copy link
Copy Markdown
Member Author

USEPARTIALS can also lead to modification of the call field. In this case we move the cursor to end of the call, as if it would my manually entered.

In order to allow editing when using USEPARTIALS we have to block further autofilling by setting block_part once we detect that the cursor was moved left from the end of the call.

@zcsahok

zcsahok commented Jul 20, 2026

Copy link
Copy Markdown
Member Author

Memory operations (pop/swap) will try to keep cursor position.
This can be changed, if needed.

@zcsahok

zcsahok commented Jul 20, 2026

Copy link
Copy Markdown
Member Author

Moving cursor to the end of the call on Fldigi grab.

@zcsahok

zcsahok commented Jul 21, 2026

Copy link
Copy Markdown
Member Author

Not directly related to editing, but fixed USEPARTIAL triggering on a numbers-only entry.
Current MASTER.SCP contains the call 8C356PDG and this made entering 80m frequency 356x impossible.

@zcsahok
zcsahok marked this pull request as ready for review July 26, 2026 14:45

@dl1jbe dl1jbe left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good.
The critical point seems the lot of 'pos = ...' manipulations. Let us hope all relevant cases are handled.

Do you want to merge it in now and do the edit of exchange in a second PR or do plan to add it to these PR also?

@zcsahok

zcsahok commented Jul 28, 2026

Copy link
Copy Markdown
Member Author

Keeping track of pos is complicated with direct accesses tot the call out of the loop. The one from fldigixmlrpc is even done from the background thread. To be fixed later, until then it works, provided one does not use the keyboard and the mouse at the same time.

Exchange will the addressed in a separate PR, but based on the solution worked out here.

@zcsahok
zcsahok merged commit 82e89dc into Tlf:master Jul 30, 2026
2 checks passed
@zcsahok
zcsahok deleted the callinput_editing branch July 30, 2026 05:21
zcsahok added a commit to zcsahok/tlf that referenced this pull request Jul 31, 2026
* add callsign input field editing using insert_car/delete_char helper functions

* USEPARTIAL: do not trigger autofill on a number

* USEPARTIALS: move cursor to the end of the call + disable further fill on editing; 

* release blocking of partials if call is empty

* try to keep cursor position for trx memory operations

* move cursor after the call on fldigi grab

* fix underlining length when autosend is used

* update man page

* remove calledit.c

* remove legacy unused para_word
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants